Search Results

Search: Posts Made By: siva kumar
2,649
Posted By vidyadhar85
Here are a few ways Using a slice: @a =...
Here are a few ways
Using a slice:

@a = @a[ 5 .. $#a ];
Using splice:

splice @a, 0, 5;
Using shift:

shift @a for 1..5;
Using grep:

my $cnt = 0;
@a = grep { ++$cnt > 5 } @a;...
Forum: Programming 04-25-2013
1,067
Posted By durden_tyler
$ $ cat f81 a 1 3;4 b 2 4;7 c 4 5;6 d 4...
$
$ cat f81
a 1 3;4
b 2 4;7
c 4 5;6
d 4 5;8
$
$
$ perl -F';' -lane 'print $F[0]' f81
a 1 3
b 2 4
c 4 5
d 4 5
$
$
$ perl -lne '/^(.*);/ and print $1' f81
a 1 3
b 2 4
c 4 5
d 4 5
2,901
Posted By MadeInGermany
The ping -c 1 $ip > /dev/null 2> /dev/null...
The

ping -c 1 $ip > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then

can be simplified

if ping -c 1 $ip > /dev/null
then

A more professional solution is
fping < file.txt
Google...
2,901
Posted By hanson44
You're very welcome.
You're very welcome.
15,731
Posted By hanson44
No, I can't write the script in perl. Sorry about...
No, I can't write the script in perl. Sorry about that. For someone who knows perl, it should not be a big deal to translate the logic into perl.
1,469
Posted By anbu23
find <path> -print | xargs grep -c word
find <path> -print | xargs grep -c word
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 07:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy