I did
a=1234
let "a=a+1"
on command line and it's fine. But when I do the same in a shell script. It prints out an error that "let: not found". Here is the script file.
#!/bin/sh
a=1234;
let "a=a+1";
echo "$a";
Thanks,
I did
a=1234
let "a=a+1"
on command line and it's fine. But when I do the same in a shell script. It prints out an error that "let: not found". Here is the script file.
#!/bin/sh
a=1234;
let "a=a+1";
echo "$a";
Thanks,
c=1
d=1
for i in `ls`
do
if [ -f $i ]
then
echo "$c -> $i"
c=`expr $c + 1`
fi
done
c=`expr $c - 1`
echo no. of files $c
for i in `ls`
do
if [ -d $i ]
then
echo "$d -> $i"
d=`expr $d + 1`
fi
done
d=`expr $d - 1`
echo no. of direcrories $d