Advertisement

03.26.2008 at 12:18PM PDT, ID: 23271756 | Points: 500
[x]
Attachment Details

Problem in CSH

Zone:

csh / tcsh

Tags:

Shell Script

I wrote a CSH file and tried running it.

Its failing with following error.

DelFUSXMLFiles.csh: line 3: =/opt/sit/aesdm/hbsemployer/logs: No such file or directory
: command not foundline 3:
find: paths must precede expression
Usage: find [path...] [expression]

If I run the commands individually then it works fine but as a script it doesnt.

I ran this file with following commands

-bash-2.05b$ ./DelFUSXMLFiles.csh
: bad interpreter: No such file or directory

-bash-2.05b$ sh DelFUSXMLFiles.csh
DelFUSXMLFiles.csh: line 3: =/opt/sit/aesdm/hbsemployer/logs: No such file or directory
: command not found line 3:
find: paths must precede expression
Usage: find [path...] [expression]

-bash-2.05b$ ./DelFUSXMLFiles.sh
: bad interpreter: No such file or directory


-bash-2.05b$ sh DelFUSXMLFiles.sh
DelFUSXMLFiles.sh: line 3: =/opt/sit/aesdm/hbsemployer/logs: No such file or directory
: command not foundline 3:
find: paths must precede expression
Usage: find [path...] [expression]
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
#!/bin/csh
 
#Path of the folder from which the files are to be deleted
 
$xml_file_dir="/opt/sit/aesdm/hbsemployer/logs";
 
#180 days is given to delete the files which are more than 6 months older
#Here files with ".xml" extensions are only deleted
 
find $xml_file_dir  -name "*.xml" -mtime +180  | xargs rm -f;
 
 
 
Expert Comment by ozo:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Author Comment by AH2008:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by ozo:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by Tintin:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by ozo:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by Tintin:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
Expert Comment by ahoffmann:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
20081119-EE-VQP-45 / EE_QW_2_20070628