?
Solved

perl

Posted on 2011-09-29
5
Medium Priority
?
432 Views
Last Modified: 2012-05-12

eval dat="$"${nf}_sw_py_th

if [ x$dat != "x" ]

what is the meaning of above statement in perl ?
0
Comment
Question by:damodar4u
  • 3
  • 2
5 Comments
 

Author Comment

by:damodar4u
ID: 36819072
in that case nf is
nf="tato-matty"
0
 
LVL 31

Accepted Solution

by:
farzanj earned 2000 total points
ID: 36819077
Are you sure this is in Perl.  It appears to be Bash (shell scripting).

The if statement is especially in Bash/Ksh.

If statement will be successful (true) if the value of $dat variable is not null.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 36819105
In the first statement, you are trying to form a variable name run time and trying to get the value of that variable.

So

The value of

$tato-matty_sw_py_th

This should be
tato_matty
0
 

Author Comment

by:damodar4u
ID: 36819130
sorry this is not perl... this is shell scripting
0
 
LVL 31

Expert Comment

by:farzanj
ID: 36819143
Yes, I know.  I hope the above answers are making sense.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

As most anyone who uses or has come across them can attest to, regular expressions (regex) are a complicated bit of magic. Packed so succinctly within their cryptic syntax lies a great deal of power. It's not the "take over the world" kind of power,…
Utilizing an array to gracefully append to a list of EmailAddresses
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Six Sigma Control Plans

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question