Appendix B Qshell versus DOS

This reference is provided for the benefit of those who have used the DOS batch language and need to learn Qshell.

Case Sensitivity

Although Unix shell commands are case-sensitive, that is not true of Qshell. For example, to get a directory listing, you can use either form of the List directory contents (ls) shown here:

ls -l LS -l

However, options are case-sensitive, so the following command is not equivalent to the previous two commands under Qshell:

LS -L

Options (Switches)

DOS options are preceded by the forward slash. Qshell options are preceded by a hyphen, or in some cases, by a plus sign. For example, in DOS, you would add an option to the directory command like this:

C:WINDOWS> dir /p

In Qshell, you would do this:

ls -l

Separation of Tokens

Qshell requires that command-line tokens be separated from one another by white space. DOS permits tokens to immediately follow one another when no confusion arises. So, the following would be acceptable in DOS:

C:WINDOWS> cd C:>

In Qshell, however, it would lead to an error:

/home/THOLT $ cd/ qsh: 001-0014 Command cd/ not found.

Instead, you would need to enter the command as follows :

/home/THOLT $ cd/ / $

Comparison of Commands

The following table gives a list of corresponding DOS and Qshell commands. Keep in mind that these are not exact equivalents ”the Qshell commands do not behave exactly like their DOS counterparts.

Corresponding DOS and Qshell Commands

Dos

Qshell

Function

assign

In

Link file.

attrib

chmod

Change file attributes.

call file

file

Execute a batch file (script).

cd

echo $PWD

Display the current directory.

cd, chdir

cd

Change the current directory.

cls

F13 key

Clear the display.

command

qsh, sh

Invoke a command shell.

copy

cp

Copy a file.

copy ... con

cat

Copy the contents of a file to stdout .

date

date

Display the date.

del

rm

Remove (delete) a file.

deltree

rm -r

Delete a directory and its contents.

dir

ls -l

Show directory contents.

dir /w

ls

Show directory contents.

echo

echo, print

Display text.

erase

rm

Remove (delete) a file.

find

grep

Search a file.

for

for

Execute a loop.

goto

None

Branch to an instruction

md,mkdir

mkdir

Create (make) a directory.

move

mv

Move a file to another directory.

path

echo $PATH.

Display the path.

pause

sleep

Suspend execution.

print

pr

Print to stdout.

prompt

PS1=value

Set the prompt string.

rd, rmdir

rmdir

Remove (delete) a directory.

prompt

PS1=value

Set the prompt string.

rem

#

Ignore a line. (In other words, include a comment.)

ren, rename

mv

Rename a file.

sort

sort

Sort stdin.

type

cat

Display the contents of a file.

xcopy

cp

Copy files.

Категории