#!/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 head -50 /etc/pjunk2 >fiftyout.txt ls -l /bin/*sh >shells.txt # Display the first two command line arguments. # Single quotes are not special inside double quotes: # echo "First is: '$1'" echo "Second is: '$2'" mkdir "$1" mv fiftyout.txt "$1" # Instead of using wc, you could use the -c option of grep here: # grep '(DAT' "$1/fiftyout.txt" | wc -l >fcount.txt mkdir "$1/$2" mv fcount.txt "$1/$2" # Add group and other read permission. Do not change other permissions. # Each file is in a different directory: # chmod go+r shells.txt "$1/fiftyout.txt" "$1/$2/fcount.txt"