- I have an IBM REXX emulator on my UNIX machine.
I also have a set of REXX files I want to run.
What should I do to those files in order to get them to run simply
by typing their file name?
Assume the REXX emulator is /usr/local/bin/rexx.
- Write a script that would display the time when run.
- Write a script that would wait 5 seconds, then display the
time, but 5 seconds late. Hint: use the "sleep" command.
- Write a script that will take a person's name as a parameter to
the program name.
The script should greet that person, as
Good Day name_entered, How are you today?
- Write a script that will prompt the user for a name.
That same name will then be displayed in the same format as the
previous exercise.
- Write a script that will return the number of parameters on the
command line.
- Write a series of scripts that will count the number of parameters
on the command line, first using the for statement, then
the while and finally the until statement.
(Three scripts).
- Write a script that will echo the third parameter, but only if it is
present.
- Given a file of numbers (one per line),
write a script that will find the lowest and highest number.
- Write a script that would recognize if a word entered from the
keyboard started with an upper or lower case character or a digit.
Use the "case" statement.
The script would then output the word, followed by "upper case",
"lower case", "digit", or "not upper, lower, or digit".
- Write a script that would first verify if file "myfile" exists. If
if does not, create it, then ask the user for confirmation to erase it...
- Write a Bourne shell script to automatically compile your
Fortran or C programs
(prog.f or prog.c).
The script should, if
a name is not provided in the command line, prompt the user
to input the program to be compiled.
Hint: use awk -F. 'print $1'.
- Write a program that will calculate the amount of disk space your
directory is using on the system.
Hint: the program could use both the du and awk commands.
- Write a program that will list the files you have in the current
directory, followed by the directories.
The output should have the form:
Files:
------
filenames
Directories:
------------
directories
- Write a program to verify how many users are logged on to the system.
- Write a program that will take an undetermined list of parameters,
and reverse them.
- Write a script that will accept any number of parameters.
The program should display whether an odd or an even number
of parameters was given.
- Write a script asking the user to input some numbers.
The script should stop asking for numbers when the number 0 is entered.
The output should look like:
user: logon_name
Lowest number entered:
Highest number entered:
Difference between the two:
Product of the two:
- Write a shell script that uses a temporary file to store the user name
and the time the script starts. The script should run for approximately
30 seconds (use the "sleep" command). Run another occurrence of that
same script, ensuring the temporary file used really has a unique name.
The script should verify that the temporary file does not exist prior
to attempting to use it.
- Write a script that changes the command line parameters to your own
login id.
- Write a script that ignores any "CTRL-C". In fact, when "CTRL-C" is
entered, it should display a message, then continue to run.
- Write a script that reads a "password" from a user (it will not show
when typed, but will get displayed after the carriage return is entered).