linux - Command not found error while shell scripting -
i'm trying execute program followed.
./chext1.sh cpp test.cpp
this should rename test.cpp test.cpp don't think script executing @ all.
consistently getting "command not found error
".
script below :
#!/bin/sh newextension=$1; oldfile=$2; firstpart=`echo $oldfile | sed 's/\(.*\)\..*/\1/'` newname="$firstpart.$newextension"; #echo $oldfile #echo $newname mv "$oldfile" "$newname" #echo "$oldfile" #echo "$firstpart" #echo "$newname"
i fixed issue. went horribly wrong when ftp'd text file contained script , transferred inside of .sh in linux. wrote in scratch in emacs , cleared up.
Comments
Post a Comment