Unix Shell - Re: error message on this script: @: Badly formed number.

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > August 2007 > Re: error message on this script: @: Badly formed number.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: error message on this script: @: Badly formed number.
janet

2007-08-31, 1:19 pm

On Aug 31, 9:38 am, Icarus Sparry <use...@icarus.freeuk.com> wrote:
> On Fri, 31 Aug 2007 07:04:44 -0700, janet wrote:
>
>
>
>
> [snip]
>
>
>
>
>
>
>
>
>
> What was the date when you got this error?
> Has there been any change to a program called "date" recently?
>
> I suspect that the problem is because the value of "mon" is "08", and
> this looks as if it ought to be an octal number.
>
> There is almost nothing in this script which is made simpler because it
> is using csh.
>
> #!/bin/sh
> # /usr/bin/clean_mereports
> # create monthly directory and move month-end reports to an archive
> # folder to save these
>
> mon=`date +%m`
> yr=`date +%Y`
> mon=`expr $mon - 1`
>
> # uncomment the following line if you want leading zeros on the
> # month so things sort better.
>
> # if [ "$mon" -lt 10 ] ; then mon="0$mon" ; fi
>
> # It would probably make more sense to have the archives as $yr$mon,
> # again to make things sort better.
>
> dir="/spool/mearchives/ret/$mon$yr"
> mkdir "$dir"
>
> find /spool/nti/retl -type file -name "*" -print |
> xargs -i -t cp "{}" $dir >> /tmp/clean_mereports.log 2>&1- Hide quoted text -
>
> - Show quoted text -


It ran fine last month but wouldn't run this month. I think that your
suspicion is correct.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com