#!/bin/sh -u # $0 dir1 dir2 # Directory maker using command line arguments. # Both arguments are directories to make. # -IAN! idallen@ncf.ca # Set standard PATH and umask: # export PATH=/bin:/usr/bin umask 022 # Display the first two command line arguments. # Single quotes are not special inside double quotes: # echo "Number one is: '$1'" echo "Number two is: '$2'" mkdir "$1" ls -l /usr/bin/*csh >cshells.txt tail -20 /etc/pjunk1 >twentyout.txt mv twentyout.txt "$1" # Instead of using wc, you could use the -c option of grep here: # grep '(DAT' "$1/twentyout.txt" | wc -l >tcount.txt mkdir "$1/$2" mv tcount.txt "$1/$2" # Add user and group write permission. Do not change other permissions. # Each file is in a different directory: # chmod ug+w cshells.txt "$1/twentyout.txt" "$1/$2/tcount.txt"