A small, portable shell written in C++. This project is intended as an exercise to improve my programming skills. The goal of this project is to create a DOS-like shell that cross-compiles on Linux and Windows.
Be the first to post a text review of Danshell. Rate and review a project by clicking thumbs up or thumbs down in the right column.
Version 2.0 -improved existing external commands. -added external commands sizeof and ls. -merged the main Danshell source into autocomplete.cpp, main.cpp and utils.cpp. -autocomplete (for file names only) has been implemented (rather nicely, in my opinion :P I'm proud of myself). -cross-compiles on Windows and Linux (just compile and link linux.cpp if you're using Linux). -remembers what you last typed; scroll with Ctrl-W and Ctrl-S. Long-term command logging is still kaput :( -implemented a user framework (login as root with password toor, use command "new user" to create a login.) Users can not yet be removed or have their passwords changed once they are created; this must be done manually. -implemented a simple path (stored in path.txt), this can only contain 1 directory at the moment :(. -implemented root permission framework. -improved the clock. -uses stringstreams to segment spaced input; no more using a text file + getline() and <fstream>. -the welcome screen is now read from a text file. -I wrote a replacement for getline() that provides the advantage of being able to parse input character by character as it is typed, e.g. tabs, special characters, Ctrl-Z and Ctrl-C, etc. -Similar to this getline() replacement (textfield()) is passfield(), which acts like getline() but doesn't display the characters as you type (it's a password field). -many other small changes. -the GNU GPL v.2.0 is actually included in the release this time (my bad :P). Version 1.0 -added external commands cat, cd, echo and yes, stored in separate binaries. (cd is not truly implemented, it just calls the OS's cd) -fixed some compiler errors. -added rudimentary logging; it doesn't work up to par, but you can find out what a user typed in. -removed nonsense commands -replaced iostream with stdio.h in external binaries and added the -s parameter to the main binary to reduce overall size. -commented more thoroughly. Version 1.0-b2 -fixed the login; it will accept an invalid username to protect against brute force attacks. Version 1.0-b1 -split danshell into 4 files and 4 headers for efficiency. -replaced all those "goto prompt;"s with a loop (finally). -added edit command. -"paint" now launches The GIMP in Linux. -added support for up to 16 command parameters. -a preferred text editor can be specified in Linux (default vi). Version 0.27: -added an operating system detector in the #include section. -split the code into functions. -rewrote the clock using <time.h> to be more portable. -the clock now shows the timezone as well as the time/date. -most variables are now stored externally. -the external variables, the OS detector and most of the #includes are now in "vars.hpp". -there are now 4 custom functions. -the custom functions are now stored in "funcs.hpp". -the 'su' function now uses getline instead of cin. -the 'exit' and 'logout' commands now log the date on which the user logged on, as well as the starting time, ending time and duration of the user's session. -the 'return' statement will now work in Linux and Windows without modification. -the computer's name is logged to a text file, so it can be remembered across sessions. NOTE: You need a file named 'computername.txt' in the same directory as 'danshell.exe' for danshell to run properly. Version 0.15: -added a clock; type 'clock' to use it. -added time and session duration to the user attributes logged on logoff/exit. -removed the 'logme' command and integrated it into the 'logoff' and 'exit'commands. -'log' now displays session duration. -'cls' clears the screen. -the root user account now requires a password and will be used in the future for system administration. -the 'su' command will attempt to logon as root. Version 0.08: -added support for calling external commands, such as 'cd' and 'ls'/'dir'. -added a 'root' user account that doesn't need a password (for faster testing). -added an OS prompt (Linux or Windows). -implemented the 'currentversion' command. -in Windows XP, the 'cmd' command will open a DOS prompt, and 'paint' will open M$ Paint. -implemented a $SHELL command. Version 0.02: -implemented logon/logoff commands. -fixed missing spaces in user command.
Version 1.0 -added external commands cat, cd, echo and yes, stored in separate binaries. (cd is not truly implemented, it just calls the OS's cd) -fixed some compiler errors. -added rudimentary logging; it doesn't work up to par, but you can find out what a user typed in. -removed nonsense commands -replaced iostream with stdio.h in external binaries and added the -s parameter to the main binary to reduce overall size. -commented more thoroughly. Version 1.0-b2 -fixed the login; it will accept an invalid username to protect against brute force attacks. Version 1.0-b1 -split danshell into 4 files and 4 headers for efficiency. -replaced all those "goto prompt;"s with a loop (finally). -added edit command. -"paint" now launches The GIMP in Linux. -added support for up to 16 command parameters. -a preferred text editor can be specified in Linux (default vi). Version 0.27: -added an operating system detector in the #include section. -split the code into functions. -rewrote the clock using <time.h> to be more portable. -the clock now shows the timezone as well as the time/date. -most variables are now stored externally. -the external variables, the OS detector and most of the #includes are now in "vars.hpp". -there are now 4 custom functions. -the custom functions are now stored in "funcs.hpp". -the 'su' function now uses getline instead of cin. -the 'exit' and 'logout' commands now log the date on which the user logged on, as well as the starting time, ending time and duration of the user's session. -the 'return' statement will now work in Linux and Windows without modification. -the computer's name is logged to a text file, so it can be remembered across sessions. NOTE: You need a file named 'computername.txt' in the same directory as 'danshell.exe' for danshell to run properly. Version 0.15: -added a clock; type 'clock' to use it. -added time and session duration to the user attributes logged on logoff/exit. -removed the 'logme' command and integrated it into the 'logoff' and 'exit'commands. -'log' now displays session duration. -'cls' clears the screen. -the root user account now requires a password and will be used in the future for system administration. -the 'su' command will attempt to logon as root. Version 0.08: -added support for calling external commands, such as 'cd' and 'ls'/'dir'. -added a 'root' user account that doesn't need a password (for faster testing). -added an OS prompt (Linux or Windows). -implemented the 'currentversion' command. -in Windows XP, the 'cmd' command will open a DOS prompt, and 'paint' will open M$ Paint. -implemented a $SHELL command. Version 0.02: -implemented logon/logoff commands. -fixed missing spaces in user command.
Version 1.0-b2 -fixed the login; it will accept an invalid username to protect against brute force attacks. Version 1.0-b1 -split danshell into 4 files and 4 headers for efficiency. -replaced all those "goto prompt;"s with a loop (finally). -added edit command. -"paint" now launches The GIMP in Linux. -added support for up to 16 command parameters. -a preferred text editor can be specified in Linux (default vi). Version 0.27: -added an operating system detector in the #include section. -split the code into functions. -rewrote the clock using <time.h> to be more portable. -the clock now shows the timezone as well as the time/date. -most variables are now stored externally. -the external variables, the OS detector and most of the #includes are now in "vars.hpp". -there are now 4 custom functions. -the custom functions are now stored in "funcs.hpp". -the 'su' function now uses getline instead of cin. -the 'exit' and 'logout' commands now log the date on which the user logged on, as well as the starting time, ending time and duration of the user's session. -the 'return' statement will now work in Linux and Windows without modification. -the computer's name is logged to a text file, so it can be remembered across sessions. NOTE: You need a file named 'computername.txt' in the same directory as 'danshell.exe' for danshell to run properly. Version 0.15: -added a clock; type 'clock' to use it. -added time and session duration to the user attributes logged on logoff/exit. -removed the 'logme' command and integrated it into the 'logoff' and 'exit'commands. -'log' now displays session duration. -'cls' clears the screen. -the root user account now requires a password and will be used in the future for system administration. -the 'su' command will attempt to logon as root. Version 0.08: -added support for calling external commands, such as 'cd' and 'ls'/'dir'. -added a 'root' user account that doesn't need a password (for faster testing). -added an OS prompt (Linux or Windows). -implemented the 'currentversion' command. -in Windows XP, the 'cmd' command will open a DOS prompt, and 'paint' will open M$ Paint. -implemented a $SHELL command. Version 0.02: -implemented logon/logoff commands. -fixed missing spaces in user command.
Version 1.0-b2 -fixed the login; it will accept an invalid username to protect against brute force attacks. Version 1.0-b1 -split danshell into 4 files and 4 headers for efficiency. -replaced all those "goto prompt;"s with a loop (finally). -added edit command. -"paint" now launches The GIMP in Linux. -added support for up to 16 command parameters. -a preferred text editor can be specified in Linux (default vi). Version 0.27: -added an operating system detector in the #include section. -split the code into functions. -rewrote the clock using <time.h> to be more portable. -the clock now shows the timezone as well as the time/date. -most variables are now stored externally. -the external variables, the OS detector and most of the #includes are now in "vars.hpp". -there are now 4 custom functions. -the custom functions are now stored in "funcs.hpp". -the 'su' function now uses getline instead of cin. -the 'exit' and 'logout' commands now log the date on which the user logged on, as well as the starting time, ending time and duration of the user's session. -the 'return' statement will now work in Linux and Windows without modification. -the computer's name is logged to a text file, so it can be remembered across sessions. NOTE: You need a file named 'computername.txt' in the same directory as 'danshell.exe' for danshell to run properly. Version 0.15: -added a clock; type 'clock' to use it. -added time and session duration to the user attributes logged on logoff/exit. -removed the 'logme' command and integrated it into the 'logoff' and 'exit'commands. -'log' now displays session duration. -'cls' clears the screen. -the root user account now requires a password and will be used in the future for system administration. -the 'su' command will attempt to logon as root. Version 0.08: -added support for calling external commands, such as 'cd' and 'ls'/'dir'. -added a 'root' user account that doesn't need a password (for faster testing). -added an OS prompt (Linux or Windows). -implemented the 'currentversion' command. -in Windows XP, the 'cmd' command will open a DOS prompt, and 'paint' will open M$ Paint. -implemented a $SHELL command. Version 0.02: -implemented logon/logoff commands. -fixed missing spaces in user command.
Version 1.0-b1 -split danshell into 4 files and 4 headers for efficiency. -replaced all those "goto prompt;"s with a loop (finally). -added edit command. -"paint" now launches The GIMP in Linux. -added support for up to 16 command parameters. -a preferred text editor can be specified in Linux (default vi). Version 0.27: -added an operating system detector in the #include section. -split the code into functions. -rewrote the clock using <time.h> to be more portable. -the clock now shows the timezone as well as the time/date. -most variables are now stored externally. -the external variables, the OS detector and most of the #includes are now in "vars.hpp". -there are now 4 custom functions. -the custom functions are now stored in "funcs.hpp". -the 'su' function now uses getline instead of cin. -the 'exit' and 'logout' commands now log the date on which the user logged on, as well as the starting time, ending time and duration of the user's session. -the 'return' statement will now work in Linux and Windows without modification. -the computer's name is logged to a text file, so it can be remembered across sessions. NOTE: You need a file named 'computername.txt' in the same directory as 'danshell.exe' for danshell to run properly. Version 0.15: -added a clock; type 'clock' to use it. -added time and session duration to the user attributes logged on logoff/exit. -removed the 'logme' command and integrated it into the 'logoff' and 'exit'commands. -'log' now displays session duration. -'cls' clears the screen. -the root user account now requires a password and will be used in the future for system administration. -the 'su' command will attempt to logon as root. Version 0.08: -added support for calling external commands, such as 'cd' and 'ls'/'dir'. -added a 'root' user account that doesn't need a password (for faster testing). -added an OS prompt (Linux or Windows). -implemented the 'currentversion' command. -in Windows XP, the 'cmd' command will open a DOS prompt, and 'paint' will open M$ Paint. -implemented a $SHELL command. Version 0.02: -implemented logon/logoff commands. -fixed missing spaces in user command.
Be the first person to add a text review.
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?
Thanks for your review!
Get credit for your review by logging in via OpenID. Click your account provider: