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
please explain the below mail2sant Shell Programming and Scripting 1 04-04-2008 09:04 AM
explain plz avikal Shell Programming and Scripting 2 04-03-2008 12:11 PM
Please can any one explain this ${0##/} gadege Shell Programming and Scripting 2 04-01-2008 04:26 PM
Can anyone explain plz r_W213 UNIX for Advanced & Expert Users 3 03-27-2007 05:52 AM
Explain awk hitmansilentass Shell Programming and Scripting 4 09-27-2006 03:14 PM

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 09-03-2007
zedex zedex is offline
Registered User
  
 

Join Date: Feb 2007
Location: india,mumbai
Posts: 139
Question perl doubt plz explain....

hi all

i wrote a shell script which uses perl script my code is :


Code:
>cat filename | while read i
>do
>perl -e 'require "/home/scripts/abc.pl" ; abc("$i")'
>done

perl script used will simply check syntax of Cobol programs but it didn't work for me so i asked my colleague he suggested following changes but i didn't get any can u explain me what exactly this mean


Code:
echo $i | perl -e 'require "/home/scripts/abc.pl" ; while (<STDIN>) {chomp $_  ; abc("$_");}'

what does $1 variable mean in perl ??
  #2 (permalink)  
Old 09-03-2007
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
$1 would contain the first matched string in a regex. For example:
Code:
$str = "something here blah blah";
$str =~ m/e(.)e/;
print $1;

this regex would match ere and r would be captured in $1
Closed Thread

Bookmarks

Tags
perl regex, shell script

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 09:51 AM.


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