CIS 218 LAB #1 Shell Cmds Advanced UNIX
CIS 218 LAB #1 Shell Cmds Advanced UNIX
1. Run the command that gives you a list of all the environment variables that are currently
set.
2. Using a pipe to the wc command, find out how many environment variables are currently
set.
3. Create a new variable called MYVAR and set its value to "myvalue". Use the command
export MYVAR to allow MYVAR to be used by sub-programs of the shell. Repeat
steps 1 and 2
4. Create a BASH script called “hello.sh” that will echo “Hello World” to the screen. Run
this using a relative path and absolute path to run the program. Why can you run it
without a PATH?
#!/bin/bash
while [ 1 ]
do
sleep 10
done
Run it.
7.