i have like this
touch /tmp/s1
touch /tmp/s2
f1=/tmp/s1
f2=/tmp/s2
if [ $f1 -nt $f2 ]
then
echo "f1 is the new file "
fi
if i run this i am getting
% slp.sh
slp.sh: test: unknown operator -nt
how can i rectify this ?
i have like this
touch /tmp/s1
touch /tmp/s2
f1=/tmp/s1
f2=/tmp/s2
if [ $f1 -nt $f2 ]
then
echo "f1 is the new file "
fi
if i run this i am getting
% slp.sh
slp.sh: test: unknown operator -nt
how can i rectify this ?
hi
use ksh or bash
#!/usr/bin/bash or #!/usr/bin/ksh in your script
check man test....
use -ne....
what are you trying to achieve...If you are trying to compare two files...
this wont help