my shell script backup.sh as below, when i execute this script, i got the error "date: command not found". I have checked that there are no space between = and the parameters.
Could anydody give an explain about this error.
Thanks.
x00004:/home/ # cat backup.sh
#!/bin/sh
set +x
source ./conf.sh
if [ $# != 2 ] ; then
echo " Usage: $0 [sftp user] [sftp pwd]"
exit 1;
fi
DATE=`date +%y-%m-%d--%H:%M:%S`
echo "${DATE}"
file=test.tar.gz
echo "Starting to backup files..."
#to backup files to sftp server
x00004:/home/ # ./backup.sh usr pwd
./backup.sh: line 11: date: command not found
Starting to backup files...
x00004:/home/poc/src #
PATHenvironment variable