I can run the script fine on 4.3 but it fails on 5.1
Error:
cd: 0403-010 A specified flag is not valid for this command.
Script:
for DIRA in `ls`
do
if [ -d $DIRA ]
then cd $DIRA <--- Line failure
ls dis* > /dev/null 2>&1
if [ $? -eq 0 ]
then
pwd > /lcca/work/tmp/faclist
fac=`cut -c17-21 /lcca/work/tmp/faclist|head -1`
echo "\n\t\t Facility $fac" >> /lcca/work/tmp/ebrlist
for n in `ls`
do
echo "\t\t $n" >> /lcca/work/tmp/ebrlist 2>&1
done
fi
cd ..
fi
done
Any help would be appreciated.
Error:
cd: 0403-010 A specified flag is not valid for this command.
Script:
for DIRA in `ls`
do
if [ -d $DIRA ]
then cd $DIRA <--- Line failure
ls dis* > /dev/null 2>&1
if [ $? -eq 0 ]
then
pwd > /lcca/work/tmp/faclist
fac=`cut -c17-21 /lcca/work/tmp/faclist|head -1`
echo "\n\t\t Facility $fac" >> /lcca/work/tmp/ebrlist
for n in `ls`
do
echo "\t\t $n" >> /lcca/work/tmp/ebrlist 2>&1
done
fi
cd ..
fi
done
Any help would be appreciated.