Hi
Am trying to move a file from one name to another
When I do "ls" to check for the moved filename
I can see the file but when I try the same with a script am unable..
I think am doing some pretty silly error.. please help..
toMove=`ls | grep -E "partition.[0-9]+"`
mv $toMove partition.[0-9]_org
if [ $? -eq 0 ]; then
echo "Success.. The value of $toMove"
else
echo "FAIL"
fi
#Checking for file has transferred..
toFind=`ls | grep -E "partition.[0-9]_org"`
if [ $? -eq 0 ]; then
echo "Success.. The value of $toFind "
else
echo "FAIL"
fi