Lab - Shell
Shell scripts setup
- make a "bin" directory for your scripts, if such does not exist:
- hide directory from others
- Check $HOME/bin is in the PATH. (How?)
- With openSUSE, all you need do is
make $HOME/bin, log off, log on again.
- We will edit
Shell scripts in $HOME/bin
- Make a program called "d" - detailed ls
- ls -l $*
- $* means all arguments that are passed to this script
- make prog executable
- Run it.
Another simple exercise:
Make a shell script called gnews.
It uses wget to grab today's news from, say,
It then searches the page (using grep) for the argument.