nadvsh

The New Adventure Shell

The New Adventure Shell is a shell script that will make your Un*x shell act like a text adventure game. It is similar to the mud-shell (available on http://www.xirium.com/tech/mud-shell/) which has been written in perl. This script however is written in ksh/bash/zsh. The script is intended to pose as little restrictions on the normal use of the shell as possible, while allowing as many adventure commands as possible, and is written for maximum portability to other Unices.
Running the script No libraries or modules are needed to run the script; start it with: . nadvsh For more documentation, see the manual page.

Portability: Tested on: Linux 2.4.19-pre6 / pdksh-5.2.14-13 Linux 2.4.19-pre6 / bash-2.05a-13 Linux 2.4.19-pre6 / zsh-4.0.2-2 AIX 4.3 / ksh AIX 4.3 / bash-2.01.0(1)-release HP-UX 11.11 / ksh HP-UX 11.11 / bash-2.05.0(2)-release SunOS 5.6 / ksh SunOS 5.8 / ksh I am still looking for testers on OSF/1, IRIX and *BSD.

Download the latest version (v1.85.3) from Sourceforge.

Sourceforge is also where the project summary is located. New features until 1.85.3: Added ‘stow away’, ‘wear’ and ‘wield’ commands Added ’emote’, ‘cal’ and ‘put’ commands Added unique colors for teleporter objects Added npc descriptions Implemented faint from exhaustion Implemented money objects (take, drop, examine and sell) Implemented displaying of chargecount in descriptions Fixed handling of cardinal numbers in item names Fixed problematic bugs in d_buy concerning armor and clothing Fixed ‘Usage:’ lines Fixed singular/plural currency form Fixed several small bugs Code cleanup and optimizations Moved manual page to section 6

New features until 1.80.5: Added buy/sell and currency commands Fixed major bugs in backpack setup procedure

New features until 1.79.4: Added theme support Added several NPC-independent-action routines (examine, eat/drink, fight, drop) Implemented dark, obscured and airless/underwater locations Rebalanced fight routines and scoring system Fixed currency handling Fixed numerous bugs and compatibility issues

New features until 1.74.1: Added implementation of object classes Added object repository Added routine to fill backpack initially Added ‘repetitive exec’ functionality Added location flags functionality Fixed kill/fight routine Fixed listing of items Updated manual for directions (ne, west, etc.), object classes Restructured manual

New features until 1.71.9: Backpacks are now fully operational for both users and NPC’s Added functionality to rename objects Added ‘look into location‘ Added ‘look at person‘ (partially) Added ‘inventory user‘ Added functionality for charm and dexterity (to be used later) Added strength checking (it is possible to die now) Fixed ‘describe’ and ‘wrap’ Fixed behavior of play/replay/noplay/quit Fixed several small bugs Code cleanup Updated manual

The inspiration for this script has come from some of the original adventure/mud-shells: advshell in Bourne Shell script, by Doug Gwyn (February 1984)
http://www.ifarchive.org/if-archive/shells/ advsh in C, by John Coker (April 1984)
http://www.ifarchive.org/if-archive/shells/ mud-shell in Perl, by Dean “Gandalf” Swift (March 2001)
http://www.xirium.com/tech/mud-shell/

/home/rene$ . nadvsh

Welcome to the new adventure shell. Use the commands ‘play’ and ‘noplay’ to start/stop playing.

You are in a nice room with a green carpet and a bed on one side of the room. There is a desk with a computer at one wall, and across the room, there is a cupboard with linguistic books and fantasy games.

Anson the hobbit enters.
Anson the hobbit asks: “You don’t happen to have anything to eat?” You are in in Rene’s room. (/home/rene)
What now?
cd ..
This is the home of the lesser gurus and the neophytes. You see pasty people sleeping. Some have a keyboard pattern imprinted on one side of their faces. These people need to get out more.

Edrion the illusionist is here.
You are in the Unix users’ home. (/home)
What now?
wait
Edrion the illusionist walks to webuser.
You are in the Unix users’ home. (/home)
What now?
cd webuser
/home/webuser
There is an orc here.
Edrion the illusionist is here.
Edrion the illusionist sneezes.
You are in /home/webuser
What now?
inv
You are carrying Gandalf’s magic staff, a backpack, a crystal ring, a diamond, a longbow, and a staff.
Edrion the illusionist whispers: “It is rumored that every man who enters this place, becomes infected with disease within a few days time!” He nods enthusiastically.
You are in /home/webuser
What now?
inv bsp
Baan application owner is not carrying anything.
The orc looks interested at your backpack.
Edrion the illusionist scratches his head.
You are in /home/webuser
What now?
examine ‘crystal ring’
The ring is made of amber crystal.
The orc leaves.
You are in /home/webuser
What now?
give ‘crystal ring’ to bsp
Okay. You give the crystal ring to bsp.
You are in /home/webuser
What now?
inv bsp
Baan application owner is carrying a crystal ring.
You are in /home/webuser
What now?
cd ~/nadvsh
/home/rene/nadvsh
You are in a laboratory with many erlenmeyers, round-bottom flasks and a destillation apparatus.
You are in a laboratory. (/home/rene/nadvsh)
What now?
cd ~michel
Michel Plasmeijer is here.
You are in /home/michel
What now?
say to michel “Hey, how are you?”
Okay. You say “Hey, how are you?” to michel.
You are in /home/michel
What now?

Send comments to René Uittenbogaard. Feedback appreciated!

Table of Basic PowerShell Commands

Command aliasCmdlet nameDescription of command
%ForEach-ObjectPerforms an operation against each item in a collection of input objects.
?Where-ObjectSelects objects from a collection based on their property values.
acAdd-ContentAppends content, such as words or data, to a file.
asnpAdd-PSSnapInAdds one or more Windows PowerShell snap-ins to the current session.
catGet-ContentGets the contents of a file.
cdSet-LocationSets the current working location to a specified location.
chdirSet-LocationSets the current working location to a specified location.
clcClear-ContentDeletes the contents of an item, but does not delete the item.
clearClear-HostClears the display in the host program.
clhyClear-HistoryDeletes entries from the command history.
cliClear-ItemDeletes the contents of an item, but does not delete the item.
clpClear-ItemPropertyDeletes the value of a property but does not delete the property.
clsClear-HostClears the display in the host program.
clvClear-VariableDeletes the value of a variable.
cnsnConnect-PSSessionReconnects to disconnected sessions
compareCompare-ObjectCompares two sets of objects.
copyCopy-ItemCopies an item from one location to another.
cpCopy-ItemCopies an item from one location to another.
cpiCopy-ItemCopies an item from one location to another.
cppCopy-ItemPropertyCopies a property and value from a specified location to another location.
curlInvoke-WebRequestGets content from a webpage on the Internet.
cvpaConvert-PathConverts a path from a Windows PowerShell path to a Windows PowerShell provider path.
dbpDisable-PSBreakpointDisables the breakpoints in the current console.
delRemove-ItemDeletes files and folders.
diffCompare-ObjectCompares two sets of objects.
dirGet-ChildItemGets the files and folders in a file system drive.
dnsnDisconnect-PSSessionDisconnects from a session.
ebpEnable-PSBreakpointEnables the breakpoints in the current console.
echoWrite-OutputSends the specified objects to the next command in the pipeline. If the command is the last command in the pipeline, the objects are displayed in the console.
epalExport-AliasExports information about currently defined aliases to a file.
epcsvExport-CsvConverts objects into a series of comma-separated (CSV) strings and saves the strings in a CSV file.
epsnExport-PSSessionImports commands from another session and saves them in a Windows PowerShell module.
eraseRemove-ItemDeletes files and folders.
etsnEnter-PSSessionStarts an interactive session with a remote computer.
exsnExit-PSSessionEnds an interactive session with a remote computer.
fcFormat-CustomUses a customized view to format the output.
flFormat-ListFormats the output as a list of properties in which each property appears on a new line.
foreachForEach-ObjectPerforms an operation against each item in a collection of input objects.
ftFormat-TableFormats the output as a table.
fwFormat-WideFormats objects as a wide table that displays only one property of each object.
galGet-AliasGets the aliases for the current session.
gbpGet-PSBreakpointGets the breakpoints that are set in the current session.
gcGet-ContentGets the contents of a file.
gciGet-ChildItemGets the files and folders in a file system drive.
gcmGet-CommandGets all commands.
gcsGet-PSCallStackDisplays the current call stack.
gdrGet-PSDriveGets drives in the current session.
ghyGet-HistoryGets a list of the commands entered during the current session.
giGet-ItemGets files and folders.
gjbGet-JobGets Windows PowerShell background jobs that are running in the current session.
glGet-LocationGets information about the current working location or a location stack.
gmGet-MemberGets the properties and methods of objects.
gmoGet-ModuleGets the modules that have been imported or that can be imported into the current session.
gpGet-ItemPropertyGets the properties of a specified item.
gpsGet-ProcessGets the processes that are running on the local computer or a remote computer.
groupGroup-ObjectGroups objects that contain the same value for specified properties.
gsnGet-PSSessionGets the Windows PowerShell sessions on local and remote computers.
gsnpGet-PSSnapInGets the Windows PowerShell snap-ins on the computer.
gsvGet-ServiceGets the services on a local or remote computer.
guGet-UniqueReturns unique items from a sorted list.
gvGet-VariableGets the variables in the current console.
gwmiGet-WmiObjectGets instances of Windows Management Instrumentation (WMI) classes or information about the available classes.
hGet-HistoryGets a list of the commands entered during the current session.
historyGet-HistoryGets a list of the commands entered during the current session.
icmInvoke-CommandRuns commands on local and remote computers.
iexInvoke-ExpressionRuns commands or expressions on the local computer.
ihyInvoke-HistoryRuns commands from the session history.
iiInvoke-ItemPerforms the default action on the specified item.
ipalImport-AliasImports an alias list from a file.
ipcsvImport-CsvCreates table-like custom objects from the items in a CSV file.
ipmoImport-ModuleAdds modules to the current session.
ipsnImport-PSSes
sion
Imports commands from another session into the current session.
irmInvoke-RestMethodSends an HTTP or HTTPS request to a RESTful web service.
isepowershell_ise.exeExplains how to use the PowerShell_ISE.exe command-line tool.
iwmiInvoke-WMIMethodCalls Windows Management Instrumentation (WMI) methods.
iwrInvoke-WebRequestGets content from a web page on the Internet.
killStop-ProcessStops one or more running processes.
lpOut-PrinterSends output to a printer.
lsGet-ChildItemGets the files and folders in a file system drive.
manhelpDisplays information about Windows PowerShell commands and concepts.
mdmkdirCreates a new item.
measureMeasure-ObjectCalculates the numeric properties of objects, and the characters, words, and lines in string objects, such as files of text.
miMove-ItemMoves an item from one location to another.
mountNew-PSDriveCreates temporary and persistent mapped network drives.
moveMove-ItemMoves an item from one location to another.
mpMove-ItemPropertyMoves a property from one location to another.
mvMove-ItemMoves an item from one location to another.
nalNew-AliasCreates a new alias.
ndrNew-PSDriveCreates temporary and persistent mapped network drives.
niNew-ItemCreates a new item.
nmoNew-ModuleCreates a new dynamic module that exists only in memory.
npsscNew-PSSessionConfigurationFileCreates a file that defines a session configuration.
nsnNew-PSSessionCreates a persistent connection to a local or remote computer.
nvNew-VariableCreates a new variable.
ogvOut-GridViewSends output to an interactive table in a separate window.
ohOut-HostSends output to the command line.
popdPop-LocationChanges the current location to the location most recently pushed to the stack. You can pop the location from the default stack or from a stack that you create by using the Push-Location cmdlet.
psGet-ProcessGets the processes that are running on the local computer or a remote computer.
pushdPush-LocationAdds the current location to the top of a location stack.
pwdGet-LocationGets information about the current working location or a location stack.
rInvoke-HistoryRuns commands from the session history.
rbpRemove-PSBreakpointDeletes breakpoints from the current console.
rcjbReceive-JobGets the results of the Windows PowerShell background jobs in the current session.
rcsnReceive-PSSessionGets results of commands in disconnected sessions.
rdRemove-ItemDeletes files and folders.
rdrRemove-PSDriveDeletes temporary Windows PowerShell drives and disconnects mapped network drives.
renRename-ItemRenames an item in a Windows PowerShell provider namespace.
riRemove-ItemDeletes files and folders.
rjbRemove-JobDeletes a Windows PowerShell background job.
rmRemove-ItemDeletes files and folders.
rmdirRemove-ItemDeletes files and folders.
rmoRemove-ModuleRemoves modules from the current session.
rniRename-ItemRenames an item in a Windows PowerShell provider namespace.
rnpRename-ItemPropertyRenames a property of an item.
rpRemove-ItemPropertyDeletes the property and its value from an item.
rsnRemove-PSSessionCloses one or more Windows PowerShell sessions (PSSessions).
rsnpRemove-PSSnapinRemoves Windows PowerShell snap-ins from the current session.
rujbResume-JobRestarts a suspended job
rvRemove-VariableDeletes a variable and its value.
rvpaResolve-PathResolves the wildcard characters in a path, and displays the path contents.
rwmiRemove-WMIObjectDeletes an instance of an existing Windows Management Instrumentation (WMI) class.
sajbStart-JobStarts a Windows PowerShell background job.
salSet-AliasCreates or changes an alias (alternate name) for a cmdlet or other command element in the current Windows PowerShell session.
sapsStart-ProcessStarts one or more processes on the local computer.
sasvStart-ServiceStarts one or more stopped services.
sbpSet-PSBreakpointSets a breakpoint on a line, command, or variable.
scSet-ContentReplaces the contents of a file with contents that you specify.
selectSelect-ObjectSelects objects or object properties.
setSet-VariableSets the value of a variable. Creates the variable if one with the requested name does not exist.
shcmShow-CommandCreates Windows PowerShell commands in a graphical command window.
siSet-ItemChanges the value of an item to the value specified in the command.

Bash Shell Command List (Linux)

categorycommanddescription
basic shellclearclear all previous commands’ output text from the terminal
exit (or logout)quits the shell
alias, unaliasgive a pseudonym to another command
(you may need to enclose the command in quotes if it contains spaces or operators)
historyshow a list of all past commands you have typed into this shell
directorieslslist files in a directory
pwddisplays the shell’s current working directory
cdchanges the shell’s working directory to the given directory; can be a relative or absolute path
mkdircreates a new directory with the given name
rmdirremoves the directory with the given name (the directory must be empty)
file operationscpcopies a file/directory
mvmoves (or renames) a file/directory
rmdeletes a file
touchupdate the last-modified time of a file (or create an empty file)
file examinationcatoutput the contents of a file
more (or less)output the contents of a file, one page at a time
head, tailoutput the beginning or ending of a file
wcoutput a count of the number of characters, lines, words, etc. in a file
dureport disk space used by a file/directory
diffoutput differences between two files
file permissionschmodchange the permissions on a file or group of files
chownchange the owner of a file
chgrpchange the group associated with a file
umaskchange the default permissions given to newly created files
searching and sortinggrepsearch a file for a given string or expression
sortconvert an input into a sorted output
uniqstrip duplicate lines
findsearch for files by name within a given directory
xargs launch a command over each of a set of lines of input (often used with find)
locatesearch for files by name on the entire system
whichshows the complete path of a command or file
compressionzip, unzipcreate a .zip archive or extract its contents
tarUnix archiving/de-archiving program
gzip, gunzipGNU compression/decompression programs
bzip2, bunzip2improved compression/decompression programs
system informationdateoutputs the current date/time
caloutputs an ASCII calendar
unameprint information about the system
timemeasure how long a program takes to run
process managementps, jobslist the processes you are running; every process has a unique integer id number (PID)
topsee what processes are using the most CPU/memory, and show system memory/CPU stats
killterminate a process
killallterminate a group of processes by name
^C or ^\(hotkey) terminates (kills) the currently running process
^Z(hotkey) suspends the currently running process
&(special character) when & is placed at the end of a command, that command is run in the background (shell does not wait for the command to finish before returning to the input prompt)
bg, fgstarts a suspended process running in the background or foreground
users and groupswhoamioutputs your user name
passwdchanges your password
groupslist the groups to which a user belongs
sudoexecute a single command as the super-user
sulog in to a shell as the super-user
multi-user environmentshostnameoutputs the name of the current computer/server
w, fingersee who is logged in to this computer
writesends a message to another user logged in to this computer
wallbroadcasts a message to all other users logged in to this computer
.plan(filename) a special hidden file you can create in your home directory, whose contents will be displayed when other users run finger on you. Was originally intended to be used to tell others what you are up to right now. (the Twitter of the 1970s!)
networklinks, lynxtext-only web browsers (yes, really)
ssh, sftp, scpconnect to a remote Unix server; open a shell on it or send/receive files from it
wgetdownload from a URL and save it to a file on the local hard drive
curldownload from a URL and output its contents to the console
pine, mailtext-only email programs
text editorspico, nanocrappy but simple text editors (recommended)
emacsa complicated text editor (not recommended)
vi, vimanother complicated text editor (not recommended)
regular expressionssedstream editor; find/replace based on regular expressions
egrepextended version of grep that matches regular expressions
programmingjavac, javacompile or run a Java program
python, perl, ruby,
gcc, sml, …
compile or run programs in various other languages
shell scriptingecho, printf like println for the shell; outputs a message or value
read reads a value from standard input
set, unset give values to a variable, or delete a variable
export sets a variable that any sub-programs launched by this shell can see
let for computing integer variable values
source executes commands/statements stored in another file
(useful for re-loading .bash_profile without logging out)
if, [, for, while bash control statements
seq outputs a sequence of integers (used with for loops)
miscellaneousyesoutput "y" (or another string) over and over
sleep, usleeppause for a given number of seconds or ms
~stepp/cowsay displays a talking ASCII cow (on attu only, though you could install it if you are using Linux on a PC)
xeyes googley eyes that follow your mouse cursor
build managementmakedetermine which parts of a system must be recompiled, and compile them
svn, cvsSubversion and CVS version-control systems
  • Source: https://courses.cs.washington.edu

MS-DOS Command List (batch)

S.NoCommands & Description
1VER This batch command shows the version of MS-DOS you are using.
2ASSOC This is a batch command that associates an extension with a file type (FTYPE), displays existing associations, or deletes an association.
3CD This batch command helps in making changes to a different directory, or displays the current directory.
4CLS This batch command clears the screen.
5COPY This batch command is used for copying files from one location to the other.
6DEL This batch command deletes files and not directories.
7DIR This batch command lists the contents of a directory.
8DATE This batch command help to find the system date.
9ECHO This batch command displays messages, or turns command echoing on or off.
10EXIT This batch command exits the DOS console.
11MD This batch command creates a new directory in the current location.
12MOVE This batch command moves files or directories between directories.
13PATH This batch command displays or sets the path variable.
14PAUSE This batch command prompts the user and waits for a line of input to be entered.
15PROMPT This batch command can be used to change or reset the cmd.exe prompt.
16RD This batch command removes directories, but the directories need to be empty before they can be removed.
17REN Renames files and directories
18REM This batch command is used for remarks in batch files, preventing the content of the remark from being executed.
19START This batch command starts a program in new window, or opens a document.
20TIME This batch command sets or displays the time.
21TYPE This batch command prints the content of a file or files to the output.
22VOL This batch command displays the volume labels.
23ATTRIB Displays or sets the attributes of the files in the curret directory
24CHKDSK This batch command checks the disk for any problems.
25CHOICE This batch command provides a list of options to the user.
26CMD This batch command invokes another instance of command prompt.
27COMP This batch command compares 2 files based on the file size.
28CONVERT This batch command converts a volume from FAT16 or FAT32 file system to NTFS file system.
29DRIVERQUERY This batch command shows all installed device drivers and their properties.
30EXPAND This batch command extracts files from compressed .cab cabinet files.
31FIND This batch command searches for a string in files or input, outputting matching lines.
32FORMAT This batch command formats a disk to use Windows-supported file system such as FAT, FAT32 or NTFS, thereby overwriting the previous content of the disk.
33HELP This batch command shows the list of Windows-supplied commands.
34IPCONFIG This batch command displays Windows IP Configuration. Shows configuration by connection and the name of that connection.
35LABEL This batch command adds, sets or removes a disk label.
36MORE This batch command displays the contents of a file or files, one screen at a time.
37NET Provides various network services, depending on the command used.
38PING This batch command sends ICMP/IP “echo” packets over the network to the designated address.
39SHUTDOWN This batch command shuts down a computer, or logs off the current user.
40SORT This batch command takes the input from a source file and sorts its contents alphabetically, from A to Z or Z to A. It prints the output on the console.
41SUBST This batch command assigns a drive letter to a local folder, displays current assignments, or removes an assignment.
42SYSTEMINFO This batch command shows configuration of a computer and its operating system.
43TASKKILL This batch command ends one or more tasks.
44TASKLIST This batch command lists tasks, including task name and process id (PID).
45XCOPY This batch command copies files and directories in a more advanced way.
46TREE This batch command displays a tree of all subdirectories of the current directory to any level of recursion or depth.
47FC This batch command lists the actual differences between two files.
48DISKPART This batch command shows and configures the properties of disk partitions.
49TITLE This batch command sets the title displayed in the console window.
50SET Displays the list of environment variables on the current system.

Source: https://www.tutorialspoint.com