I've tried your script, here it is :
****************************************
#!/bin/sh
cd /opt/adoc/input_data/boeing/sample
for file in *.SGM
do
newname=$(basename $file .SGM).sgm
echo mv ${file} ${newname}
done
******************************************
but they responded with this :
/opt/adoc/test: syntax error at line 7: `newname=$' unexpected
I've changed it so it becomes :
***********************************************
#!/bin/ksh
cd /opt/adoc/input_data/boeing/sample
for file in *.SGM
do
newname='basename $file .SGM'.sgm
echo mv ${file} ${newname}
done
**************************************************
and the result it :
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.