Computing.Net > Forums > Unix > test argument

test argument

Reply to Message Icon

Original Message
Name: aline
Date: May 10, 2006 at 03:23:24 Pacific
Subject: test argument
OS: Solaris 8
CPU/Ram: 4x1200MHz/8gb
Model/Manufacturer: 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


Report Offensive Message For Removal

Response Number 1
Name: lchi2000g
Date: May 12, 2006 at 09:42:45 Pacific
Subject: test argument
Reply: (edit)

replace:

[ !-f $NEXT ]

with:
[ !-f "$NEXT" ]


Luke Chi


Report Offensive Follow Up For Removal

Response Number 2
Name: aline
Date: May 16, 2006 at 06:53:33 Pacific
Subject: test argument
Reply: (edit)

Thanks, it worked a treat !


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: test argument

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software