The reason you were getting syntax errors is that backticks in Perl will undergo what the documentation calls "double-quotish" expansion. Basically, this means that if you want a backslash to be passed to the shell, you will need to double it, because Perl already parses one level of backslashes. Also, the value of $line is being interpolated by Perl, so the shell sees the literal value echo USING (FILE '/TEST1/FILENAME'5000) without any quoting, and complains about the opening parenthesis. You can get around this with proper quoting; but of course, for trivial string manipulations, Perl itself is actually much better suited than the shell.
im trying to extract some tags between and in a file..for eg..the file format is
I want the and extracted from the file i.e the tags which is present b/w and
I have the regex for extracting the tags from the whole file but how to specify my search within the and... (1 Reply)
Hi Team,
I have two strings like:
xxx|yyy|Arizona Cardinals| Tell Cardinals | Cardinals
bbb|Bell Earn, Jr | Bell Earn | Jayhawks | hawks
I have a lookup file which has a set of strings. These need to be removed from above two strings
Lookup file Contents:
Bell Earn, Jr
hawks... (2 Replies)
Hello all,
i am in a bit of dilema here. i dont know any thing about perl or python. only know a little bit of awk. now unable to take a decission as to which language to go for. my requirement is building a testing framework.suite which will execute ssytem comands remotely on unix... (2 Replies)
Take a look at this code:
#!/usr/bin/perl
use 5.008;
$_ = "somename@address.com";
if(/\@\w+\.com/)
{
print "\n\nmight be an email address\n\n";
}
else
{
print "\n\nnot an email address\n\n";
}
Shouldn't the /\@\w+\.com/ evaluate as true? I've also tried:
... (3 Replies)
i have a set of regular expressions. The words in the regular expression should be used to replace the i/p with hyphens '---'. i need perl script to evaluate these regular expression. the words in the regexes when found in the i/p file should be replaced with hyphens '---'.
the set of regular... (3 Replies)
Hello everybody,
I am trying to connect from hp-ux to win 2003 using perl's Net::Telnet module. Seeing the examples in couple of web sites, I saw I have to declare a Prompt =>
Can somebody please tell me what my regular expression should be? The prompt after I log in is:
...
login:... (1 Reply)
Hello guys/gals,
i am sorry as this is probably very simply but i am slowly learning perl and need to convert some old korn shell scripts.
I need to be able to search a file line by line but only match a string at particular location on that line, for example character 20-30. So my file... (4 Replies)
Hello,
$line=USING (FILE '/TEST1/FILENAME'5000)
I want to reterive the value between ' and ) which is 5000 here.
i have tried out the following expressions ...
Type 1 : $Var1=`sed -e 's/.*\' //' -e 's\).*$/' $line`;
Type 2 : $Var1=`echo $line | awk -F"\'" '{print $2}' | awk -F"\\)"... (1 Reply)
how to find for a file whose name has all characters in uppercase after 'project'?
I tried this:
find . -name 'project**.pdf'
./projectABC.pdf
./projectABC123.pdf
I want only ./projectABC.pdf
What is the regular expression that correponds to "all characters are capital"?
thanks (8 Replies)
I am writing script that will act like the 'comm' utility. My
problem is when trying to read whether the user has entered -123 or -1
or -1...etc.
I currently have:
if(m/??/g){
print "Good.\n";
}
So, this should check for all... (1 Reply)