Using "Linux shell Scripting With Bash" as a guide I wrote this:
# !/bin/bash # # hdds.sh # A hard drive scrubbing utility. # written by James M. Thigpen (delta435@gmail.com) # hdds <target> # !WARNING! | DESTROYS ALL DATA ON TARGET DEVICE | !WARNING! # step 1: is user argument valid? if $# -lt 2; then printf "%q" "Too Few Arguments!" printf "%q" "hdds <target>" fi # step 2: is the user willing to continue? if "$3" != "-y"; then printf "WARNING : THIS WILL DESTROY ALL DATA ON $2 : WARNING" printf "Do you wish to continue? <Y/N> [ENTER]" read resp if ["$resp" != ["Y" || "y"]]; then exit 1 #Script ends here fi fi # Step 3: Does device exist? if -f $2; then #begin scrub export counter = 0 while [count -lt 20]; do export val1 = $RANDOM cat val1 > $2 let "counter=counter+1" done fi printf "Done." exit 0; #END
On execution I get this:
/home/devel/Development/Bash/hdd_scrub/hdds.sh: line 11: 1: command not found /home/devel/Development/Bash/hdd_scrub/hdds.sh: line 17: : command not found /home/devel/Development/Bash/hdd_scrub/hdds.sh: line 28: -f: command not found
Whats wrong here?
Thanks
This post has been edited by Delta_Echo: 25 February 2009 - 09:18 AM

New Topic/Question
Reply




MultiQuote




|