On Sat, 14 Jan 2006 12:26:35 +0100 Matthijs <[EMAIL PROTECTED]> wrote:
> On Sat, 14 Jan 2006 11:40:13 +0100, John Smith <[EMAIL PROTECTED]> > wrote: > > > which heroe can tell me why the following does not work : > > > > #!/bin/sh > > cat <<EOF >newscriptfile.sh > > #!/bin/sh > > NOWS=$(date +%S) > > NOWS=${NOWS#0} > > NOWM=$(date +%M) > > NOWM=${NOWM#0} > > NOWH=$(date +%H) > > NOWH=${NOWH#0} > > FROMNOW=$1 > > > > MINUTE=$((${NOWM} + ${FROMNOW})) > > MINUTE=$((${MINUTE} % 60)) > > HOUR=$((${NOWM} + ${FROMNOW})) > > HOUR=$((${HOUR} / 60)) > > HOUR=$((${NOWH} + ${HOUR})) > > HOUR=$((${HOUR} % 24)) > > echo $HOUR" "$MINUTE > > EOF > > > Exactly *what* doesn't work? If I execute is at 12:25 as follows: > > > ./newscriptfile.sh 1 > 12 26 > > ... seems correct to me. What error do you get? > -- > Matthijs > [EMAIL PROTECTED] > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > Matthijs, I got hostname:~# ./test.sh ./10.sh: line 2: + : syntax error: operand expected (error token is " ") hostname:~# To get this got to execute the whole part, not only the part after the cat till the EOF. That part works. Sincerely, Jan. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]