Computing.Net > Forums > Unix > test argument

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

test argument

Reply to Message Icon

Name: aline
Date: May 10, 2006 at 03:23:24 Pacific
OS: Solaris 8
CPU/Ram: 4x1200MHz/8gb
Product: SunFire/V1280
Comment:

Trying to write a script to move files and tag, said files so that we still have original file and a tag file to signify file already moved, this works ok the first time, but when script is run again trying to move next lot of new files I am being asked for a test argument in script. Ran this with ksh -x this is part of output
ls -lt file.rtf file1.rtf file11.rtf file12.rtf file13.rtf file14.rtf file15.rtf file2.rtf file3.rtf file4.rtf file5.rtf file6.rtf
+ cut -c54-67
+ 1> /export/home/itstech/frbtag/test.tmp
+ x=0
+ + cat /export/home/itstech/frbtag/test.tmp
+ wc -l
rec= 12
+ [ 0 -le 12 ]
+ head -1 /export/home/itstech/frbtag/test.tmp
+ 1> /export/home/itstech/frbtag/record
+ cat /export/home/itstech/frbtag/record
+ read NXT
+ [ !-f file15.rtf_tag ]
mobbcpy[18]: test: argument expected
+ sed 1d /export/home/itstech/frbtag/test.tmp



Sponsored Link
Ads by Google

Response Number 1
Name: lchi2000g
Date: May 12, 2006 at 09:42:45 Pacific
Reply:

replace:

[ !-f $NEXT ]

with:
[ !-f "$NEXT" ]


Luke Chi


0

Response Number 2
Name: aline
Date: May 16, 2006 at 06:53:33 Pacific
Reply:

Thanks, it worked a treat !


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


unix script exit status Script remove file



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: test argument

If statement exception www.computing.net/answers/unix/if-statement-exception/7442.html

IF condition after substr www.computing.net/answers/unix/if-condition-after-substr/4000.html

if [ -O $variable ] doesn't work?? www.computing.net/answers/unix/if-o-variable-doesnt-work/5448.html