Execution problems with Find


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Execution problems with Find
# 1  
Old 07-02-2010
Question Execution problems with Find

the below cmd is not wrking in perl script


find . -name "*e*" -exec wc -l {} \;

its show the following error

Can't modify system in scalar assignment at prjt.pl line 4, near ");"
Execution of prjt.pl aborted due to compilation errors.
# 2  
Old 07-02-2010
can you please give me complete code
# 3  
Old 07-02-2010
Quote:
Originally Posted by rsivasan
can you please give me complete code
this is my complete code.

its working individual, but not working n perl script .

Code:
 
find . -name "*e*" -exec wc -l {} \;



---------- Post updated at 04:46 AM ---------- Previous update was at 03:03 AM ----------

HI All,

can any one help me to slove this issues
# 4  
Old 07-02-2010
Yeah show us how did you use it in Perl code.

If it is the only line, then why does the error says 4th line ?
Also you cannot use find command directly in perl program.. you have to atleast back tick it or use system..
# 5  
Old 07-02-2010
Question

Quote:
Originally Posted by natraj005
this is my complete code.

its working individual, but not working n perl script .

Code:
 
find . -name "*e*" -exec wc -l {} \;



---------- Post updated at 04:46 AM ---------- Previous update was at 03:03 AM ----------

HI All,

can any one help me to slove this issues
Where is your perl code?
# 6  
Old 07-05-2010
Quote:
Originally Posted by cola
Where is your perl code?

this is my perl code
Code:
 
 
#!/usr/bin/perl
system = ("find . -name '*e*' -exec wc -l {} \;");

error is

Can't modify system in scalar assignment at prjt2.pl line 2, near ");"
Execution of prjt2.pl aborted due to compilation errors.
# 7  
Old 07-05-2010
You're trying to assign something to a command. Remember, variables in Perl always have to be prefixed by one of '$', '@', '%' for scalars/arrays/hashes.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Execution Problems with Solaris 8

i have problems with using solaries 8 . code and commands for extracting files from CD ? especially extracting file.jar from package and batch (1 Reply)
Discussion started by: moh_abaloo
1 Replies

2. Shell Programming and Scripting

Execution Problems with awk

Ubuntu, Bash 4.3.48 Hi, I have this input file: a1:b2:c30:g4:h12:j7 and I want this output file: a1=g4:b2=h12:c30=j7 I can do it this with this code: awk -F':' '{print $1"="$4":"$2"="$5":"$3"="$6"}' INPUT > OUTPUTIn this case I have 6 columns, I calculate manually the half number of... (6 Replies)
Discussion started by: echo manolis
6 Replies

3. UNIX for Beginners Questions & Answers

Execution problems

How to find a word in a directory which contains many files? i just want to count how many such words are present in all the files? This is the code which i tried for a single file echo "Enter the file name:" read file echo "Enter the word to search:" read word if then echo "The count... (4 Replies)
Discussion started by: Meeran Rizvi
4 Replies

4. Solaris

Execution problems with Mailx

Unable to send mail using mailx command. I am using solaris 5.9 I am trying to send notification for the scheduled jobs in crob but the mailx is not working. Checked the settings in submit.cf and sendmail.cf but unable to find the solution. Error message root@sshldb # nslookup mailhost... (8 Replies)
Discussion started by: Srinathkiru
8 Replies

5. Shell Programming and Scripting

Execution problems with scripting

Hi, I am new to scripting.I had one problem infront of me.I tried in many ways with minimal knowledge........Kindly help me. Description: I want a shell script where it has to read an input.txt file and need to remove duplicate lines and the result need to kept in output.txt file. input... (5 Replies)
Discussion started by: bhas
5 Replies

6. Shell Programming and Scripting

Execution Problems

this my source file ************* fixed *************** Begin equipmentId : d9 processor : fox number : bhhhhhh Variable # 1: Id : 100 Type : 9 nType : s gType : 5f mType : 4 LField : England DataField : london Length ... (6 Replies)
Discussion started by: teefa
6 Replies

7. Shell Programming and Scripting

Execution Problems!!

i have been working on this for a about 12 hours today say's end of file un expected any idea's using the bourne shell and its driving me nuts worked fine in bash but prof says make it work in bourne and good luck worth 13% any help would be awesome #!/bin/sh trap "rm mnt2/source/tmp/* 2>... (1 Reply)
Discussion started by: mrhiab
1 Replies

8. Programming

execution problems with cron

how to store a date into file? and how we can access date from the file? ---------- Post updated at 06:09 AM ---------- Previous update was at 06:08 AM ---------- how we can store date in file? (1 Reply)
Discussion started by: causalmodi777
1 Replies

9. Shell Programming and Scripting

execution problems with curl

I have been getting error "curl: (7) Failed to connect to IP number 1" when using the CURL command Could someone help??? (1 Reply)
Discussion started by: infernalhell
1 Replies

10. UNIX for Dummies Questions & Answers

Execution problems with crontab

I need your help please Inin a production system i found crontab entries was removed because i typed crontab -l with username corasc and didn't show anything. i asked the administrador to restored the mentioned crontab, he restored the crontab: The problem is when restored the crontab file is... (2 Replies)
Discussion started by: alexcol
2 Replies
Login or Register to Ask a Question