The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find Files in a Directory Excluding Subdirectories Amol_Dicholkar UNIX for Dummies Questions & Answers 2 12-11-2008 07:54 AM
How to remove directory with subdirectories and files? ppa108 UNIX for Dummies Questions & Answers 9 11-25-2008 02:02 AM
search files in a directory and its subdirectories Net-Man Shell Programming and Scripting 1 09-04-2008 10:25 PM
Shell:Find a word in files in a directory and subdirectories yeclota Shell Programming and Scripting 4 08-29-2008 06:05 AM
Find all files created by a specified user in a directory and its subdirectories abhilashnair UNIX for Dummies Questions & Answers 5 06-13-2007 03:37 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-28-2009
vyasa vyasa is offline
Registered User
  
 

Join Date: May 2009
Posts: 6
above commands showing error when run with back quotes in perl script
  #2 (permalink)  
Old 05-28-2009
devtakh devtakh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore
Posts: 514
Quote:
Originally Posted by vyasa View Post
above commands showing error when run with back quotes in perl script
What command are you trying to run?
  #3 (permalink)  
Old 05-28-2009
dinjo_jo dinjo_jo is offline
Registered User
  
 

Join Date: May 2008
Posts: 78
You will have to use escape characters to use them
  #4 (permalink)  
Old 05-28-2009
vyasa vyasa is offline
Registered User
  
 

Join Date: May 2009
Posts: 6
hi dinjo,

can you please be more specific as to how to use escape sequences to make this command work in perl
  #5 (permalink)  
Old 05-28-2009
dinjo_jo dinjo_jo is offline
Registered User
  
 

Join Date: May 2008
Posts: 78
Just a example.See the backslash

/usr/bin/awk \'{ if (\$1 > 85) {print \$1 \$4\ } } \' | grep -v \"Name\"
  #6 (permalink)  
Old 05-29-2009
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,556
don't need to use the system find command. you can use Perl's module File::Find.
  #7 (permalink)  
Old 05-29-2009
funksen funksen is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 431
yes use the File::Find module
anyway, that's the way you can get your above command to work without great masking:

Code:
$a='find . ! -user 0 -exec ls -l {} \; | awk \'{print $3,$9}\'';
system ("$a");

the only thing you have to mask are single quotes

if you wan't to use a variable out of the perl script, use a="command" ; and just mask the \" in your command
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0