I'm trying to execute the program as followed.
./chExt1.sh cpp test.CPP
This should rename test.CPP to test.cpp but I don't even think this script is executing at all.
I am consistently getting this "command not found error".
The script is 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"
echo, do they show proper data when uncommented?sedinstalled? What Linux OS are you using?#!/bin/sh -xIt really helps with troubleshooting..you can see what is going on while it executes.