file in $directory/* # Filename globbing.
do
filename=${file%.*c} # Strip ".mac" suffix off filename
#+ ('.*c' matches... s, but it can also be used to create fixed length files. Here a 1-megabyte file is created with the filename myfile.
dd if=/dev/zero of=myfile count=512 ... directories is a fairly common task when copying files around. This function will test the filename passed to the function to see if it is a dire... does what nl does best – numbering the lines in a file. The original file is not overwritten.
number_file()
# number_f
ript (error code).
fi
filename=$1
if [ ! -f "$filename" ] # Quoting $filename allows for possible spaces.
then
echo "File $filename not found!" >&2 # Error message to stderr.
ex... ng bracket in variable substitution.
then
echo "File $1 is not a gzipped file!"
exit $E_NOTGZIP
fi
zcat $1 | more
# Uses