cp /usr/fs/sbj/public/xxx xxx
where xxx is something different each time. You can place a
template for this command in a file and then ask ksh to execute
the template using a particular file name for xxx each time. This
kind of file is called a shell script.
Use vi (or your favourite editor) to create a file called, say, cpp, and in it put the line
cp /usr/fs/sbj/public/$1 $1
($1 stands for ``the first parameter''). You must inform ksh
that cpp is something that it can execute by changing its mode using the changemode command
chmod u+x cpp
(This gives (+) the owner (u, for `user')
execute (x) permission for the file cpp.)
Now if you type the command
cpp boxes.p
then ksh will execute
cp /usr/fs/sbj/public/boxes.p boxes.p
In particular, you have a shell script in your home directory called .profile (note: you need to use ls -a to see files that have names starting with . in a directory listing). .profile is executed automatically each time that you open a new xterm window, to initialize the ksh that runs in that window. It is usual to include shell commands in .profile to set up configuration information and perform useful actions (such as checking for mail or new bulletins). If there is anything that you need to have done in each window, then you can put appropriate commands in your .profile.
echo Greetings. Your every wish is my command ...
PS1='Well, what now? '
alias lspas='ls *.p'
Now open a new window (option in root window mouse menu). You are
greeted, the command prompt has changed to a rather impatient sounding
question, and the alias lspas has been set up.
echo is a built in ksh command.
PS1 is called a shell variable - see next.
ksh uses the current value of PS1 as the command prompt; you can change it any time you want by typing a command like the one in the .profile (i.e. PS1=...) - but note that the change applies only in the current window.
If you type the command
set
then ksh will give you a listing of all the shell variables that
are currently set, together with their current values.
This is the end of the useful tips about Unix - the tips have covered a variety of the commonly used facilities, and hopefully they have given some pointers to the other facilities on offer. If you want to know more about using ksh, then read the manual pages produced by the command man ksh - but this is definitely not to be recommended for the faint hearted, because it is very long and quite indigestible!