10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Please help me to understand the following code:
perl -lne 'print if "$_ " =~ /(5 (?:\d+ ){5})\1/'
What the regular expression "?:" does?
Also, whether the expression "\1" is the same as in sed (i.e) printing the elements inside pair of parentheses? (3 Replies)
Discussion started by: royalibrahim
3 Replies
2. Shell Programming and Scripting
Hi,
In the following perl code:
#!/usr/bin/perl -w
if (open(FILE, "< in_file")) {
while (<FILE>) {
chomp($_);
if ($_ =~ /patt$/) {
my $f = (split(" ", $_));
print "$f\n";
}
}
close FILE;
}
Why changing the "FILE" as... (4 Replies)
Discussion started by: royalibrahim
4 Replies
3. Shell Programming and Scripting
Anyone please say what is the difference between $var and ${var} in perl
Sometimes $var used and sometimes ${var} used in same program.
Thanks in Advance,
Prabhu
---------- Post updated at 09:34 AM ---------- Previous update was at 05:59 AM ----------
Any one please clarify (1 Reply)
Discussion started by: prsampath
1 Replies
4. Shell Programming and Scripting
Hello ,
Please can someone tell me what exactly happens when the below filehandler is chomped into an array and later mapped.
$lcpLog="logcopy\@".getTimestamp."\log";
open CFg ,"< $lcpcfg";
chomp(@cfg = <CFG>);
close CFG;
@cfg=grep { $_ ne ' ' } map { lc + (split /\s*\/\//) }... (0 Replies)
Discussion started by: rmv
0 Replies
5. Shell Programming and Scripting
Hi,
I need to execute output one command in csh.
Eg:
#!/bin/csh
set smal = "set count = 1"
grep "Tot" in_file | sed "s/Tot/$smal/g"
In the above script, i have set the smal variale as "set count = 1".
My desired output like:
$echo count
should show as 1. (1 Reply)
Discussion started by: vasanth.vadalur
1 Replies
6. Shell Programming and Scripting
Hi..
When i was just looking throught /etc/inittab file..
i had stuck with some problems that i dont known in shell scripts
Here how the lablel like
si
ca
lo
l1
etc works..
do scripts proivide any label features..
please help...
thanks in advance
esham (3 Replies)
Discussion started by: esham
3 Replies
7. Solaris
Hi,
I want to execute around fifty commands on a server. I want to make it using a single command by placing the commands in a script. How to do this. (4 Replies)
Discussion started by: rogerben
4 Replies
8. UNIX for Advanced & Expert Users
Hi Guys,
I am new to this forum, i have doubt with a awk script. I want to generate a list where i can busiest hour from a list of a data.
05/19/2008 14:27:19 - avg: 0 max: 0 min: 0 samples: 0 total: 0
05/19/2008 14:28:19 - avg: 0 max: 0 min: 0 samples: 0 total: 0
05/19/2008 14:29:19 -... (2 Replies)
Discussion started by: asirohi
2 Replies
9. Shell Programming and Scripting
Hi,
While reading a shell script ,i have come accross the following statements.
script_name_full=$0
***script_name=${script_name_full##*\}
***script_name_noexst=${script_name%%\.ksh}
host_name=`hostname`
***host_name_short=${host_name%%\.*}
can anybody tell me what is the purpose of marked... (5 Replies)
Discussion started by: ravi raj kumar
5 Replies
10. Shell Programming and Scripting
hi all
i wrote a shell script which uses perl script my code is :
>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... (1 Reply)
Discussion started by: zedex
1 Replies