team2005
asked on
Script dosent work ?
Hi!
The given source script give me this error message:
Illegal variable name.
What is wrong with this script ?
Please help asap.
The given source script give me this error message:
Illegal variable name.
What is wrong with this script ?
Please help asap.
if [ $(date +%A) == "Friday" ]; then
if [ -f backupfile ]; then
cp backupfile /BACKUPFRIDAY/backupfile-`date +"%Y%m%d"`;
else
echo "friday backup file missing" | mail yourmail@ddress -s "missing backup" -;
fi;
fi;
ASKER
Hi!
Still dosent work, but it give this output:
Line 24 : [Friday==Friday] : command not found
Still dosent work, but it give this output:
Line 24 : [Friday==Friday] : command not found
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi"
Still dosent work ?
Tor
Still dosent work ?
Tor
Run the script as
sh -x scriptname
and post the output.
sh -x scriptname
and post the output.
Is the script set to use the bash shell?
#!bin/bash
#!bin/bash
ASKER
Hi!
Yes, its set to use the bash shell.
Tor
Yes, its set to use the bash shell.
Tor
can you post the output of
sh -x scriptname
as requested before?
sh -x scriptname
as requested before?
ASKER
Hi!
Have give you that aoutput:
Line 24 : [Friday==Friday] : command not found
Tor
Have give you that aoutput:
Line 24 : [Friday==Friday] : command not found
Tor
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
here it shows that it is space problem. did you try to put space before and after the == and [ ]
ASKER
Hi!!
Tryed zmo code, and works now :)
Split the points then :)
Thanks for help.
Tryed zmo code, and works now :)
Split the points then :)
Thanks for help.
if [ $(date +%A) == "Friday" ]; then
if [ -f backupfile ]; then
cp backupfile /BACKUPFRIDAY/backupfile-`
else
echo "friday backup file missing" | mail yourmail@ddress -s "missing backup"
fi;
fi;
if you still have problem run the script as
sh -x scriptname
and post output