Advertisement

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

Problem in CSH

Asked by AH2008 in 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]
Start Free Trial
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;
[+][-]03.26.2008 at 12:33PM PDT, ID: 21215298

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 12:42PM PDT, ID: 21215400

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 12:59PM PDT, ID: 21215575

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 01:48PM PDT, ID: 21216042

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 02:00PM PDT, ID: 21216164

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.26.2008 at 02:08PM PDT, ID: 21216223

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.05.2008 at 07:32AM PDT, ID: 21288260

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628