Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making perl variable visible to shell 1

Status
Not open for further replies.

harishram

Programmer
Aug 10, 2005
6
0
0
US
Folks i have a question.

$vfy_status = `grep ^use executecommand_withoutarguments.pl`;

$vfy_suc = `print $vfy_status| awk '{print $1}'`;

print $vfy_suc;

i am not able to export the perl variable $vfy_status, how do i overcome it and make perl variables visible to the shell.

thanks for ur help.
 
If every thing is already stored in $vfy_status, why use another variable and then call upon awk to get the first field. "split" would work in this case.

or

$vfy_status can be expanded to use the awk statement with in.
 
Thanks for your reply max1x.

Can you give me an example of the second option please, i did not fully understand it. what is the meaning of expanding $vfy_status ?
 
In this stmt, I'm not sure what grep is doing

$vfy_status = `grep ^use executecommand_withoutarguments.pl`;

but if a flat file is being read, then:

$vfy_status = `cat path/filename | grep for a pattern | awk '{print \$1}'`; ---> note the \ before $1

print $vfy_status

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top