10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have a file as below
sample.pl
parameter1
argument1
argument2
parameter2
I want out as below
argument1
argument2
that is , i want to print all the lines between parameter1 & parameter 2.
i tried with the following
if($mystring =~ m/parameter1(.*?)parameter2/) (2 Replies)
Discussion started by: roopa
2 Replies
2. Shell Programming and Scripting
Hi All,
I have pearl script which will check and convert the file:
INFO("dos2unix_cmds".$#{$dos2unix_cmds});
if ( $#{$dos2unix_cmds} == 0 ) {
my $convert_cmd = $$dos2unix_cmds;
my $rename_cmd = $$dos2unix_cmds;
--conversion going here
else
INFO ("No need to... (8 Replies)
Discussion started by: saps19
8 Replies
3. Shell Programming and Scripting
Hi All,
I have a perl script which I am using in Windows environment. There is one more file called "functions.txt" which is having all the functions defined to used in my perl script. And the path for this function file is defined in my perl script. Howeever sometimes I am getting below error... (4 Replies)
Discussion started by: gr8_usk
4 Replies
4. Shell Programming and Scripting
How can i print the output of a perl script on a unix console and redirect the same in a log file under same directory simultaneously ?
Like in Shell script, we use tee, is there anything in Perl or any other option ? (2 Replies)
Discussion started by: butterfly20
2 Replies
5. Shell Programming and Scripting
I'm having trouble with this code.
if i do
.\read.pl -u user
it prints out
2010-12-20 12:00:00 host1 <cmd>a
2010-12-20 12:00:01 host1 <cmd> <execute>
2010-12-20 12:00:02 host1 <cmd>b
2010-12-20 12:00:03 host1 <cmd>c
however, if i enter
.\read.pl -h host1
it should... (3 Replies)
Discussion started by: kpddong
3 Replies
6. Shell Programming and Scripting
Good evening to you all perl experts
I need your help
I have a very simple script where I´m trying to print a line from status.dat file.
The script will find the line containing "servicestatus", and I want to print the content of the next line.
For example, the file contains this text:... (6 Replies)
Discussion started by: zarahel
6 Replies
7. Shell Programming and Scripting
Hi Perl Gurus,
perl -e 'print "http://www.site@domain.com"'
The output of the above is :
http://www.site.com"
I want to print http://www.site@domain.com without using escape sequence before '@' like '\@'.
Is there any way to do this in perl?
Thanks,
Som (1 Reply)
Discussion started by: som.nitk
1 Replies
8. Shell Programming and Scripting
#!/usr/local/bin/perl
open (MYFILE, 'logs_report');
while (<MYFILE>) {
$rec=$_;
chomp ($rec);
@arr=split(/ /,$rec);
print $rec,"\n" if ($arr!~/OK/);
open (MYF, '>data.txt');
print $rec,"\n" if ($arr!~/OK/);
close (MYF); (14 Replies)
Discussion started by: SkySmart
14 Replies
9. Shell Programming and Scripting
Please help me with my script please. I am trying to do the following:
1. Read files for the current directory
2. Open and read from nbe files files only
3. Read only the lines with the results pattern
4. Split the line and print 3rd field
Please indicate what line I need to modify. ... (8 Replies)
Discussion started by: jroberson
8 Replies
10. Shell Programming and Scripting
i'm writing some simple scripts to help me learn perl.
why does the print command get called after the shell script is executed?
the purpose of the shell script is to simply echo to the screen "script run". which is does, but before the print command, you can clearly see the shell script is... (3 Replies)
Discussion started by: mjays
3 Replies