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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -