10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to exlude a list of values with perl to process while reading in a file. Is there a way to use the next if with a list?
Example:
@array = qw(val1 val2 val3 val6);
while (<>) {
next if $_ =~ @array; # values I don't want to process here
print; # process the rest here
}... (8 Replies)
Discussion started by: timj123
8 Replies
2. Shell Programming and Scripting
I know that
@food = %fruit;
Works. But how do I assign %fruit and %veggies to @food ? (2 Replies)
Discussion started by: popeye
2 Replies
3. UNIX for Advanced & Expert Users
Hi,
i want to search and replace array values by using perl
perl -pi -e "s/${d$i]}/${b$j]}" *.xml
i am using while loop for the same. if i excute this,it shows "Substitution replacement not terminated at -e line 1.".
please tell me what's wrong this line (1 Reply)
Discussion started by: arindam guha
1 Replies
4. Shell Programming and Scripting
Hi
Input:
{ committed = 782958592; init = 805306368; max = 1051394048; used = 63456712; }
Result:
A map (maybe Associative Array) where I can iterate through the key/value. Something like this:
for key in $map
do
echo key=$key value=$map
done
Sample output from the map:
... (2 Replies)
Discussion started by: chitech
2 Replies
5. Shell Programming and Scripting
Hello to all in forum,
Maybe some awk expert could help me.
I have this sample input:
<MGISP:IMSIS=99995626;
MT IMSI NUMBER SERIES ANALYSIS DATA
OPERATING TABLE
IMSIS M NA ANRES
99995626 6-77182 4 OBA-200
... (9 Replies)
Discussion started by: Ophiuchus
9 Replies
6. Shell Programming and Scripting
Need a urgent help
I have a data like below
044 CN CNP
032 MB MBD
567 NH NHI
678 GY GYP
.
.
.
.
250 records
above data are loaded from a table ...
I have a shell script which will read each line and in a specific position it has extn code like ... 044 or 032 ...
i need... (3 Replies)
Discussion started by: greenworld123
3 Replies
7. Shell Programming and Scripting
Hi,
Is there an easy way to simulate following Perl code in Bash.
if ( grep {$my_value eq $_} @ARGV ){
print "Do Something\n";
} else {
die "Invalid value";
} (0 Replies)
Discussion started by: paragkalra
0 Replies
8. Shell Programming and Scripting
Hi All,
I'm writing a nagios check that will see if our ldap servers are in sync...
I got the status data into a nested array, I would like to search key of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable
so...eg...let take the single array... (1 Reply)
Discussion started by: zeekblack
1 Replies
9. Shell Programming and Scripting
Hi
can anyone suggest me how to write a file containing values,... say
19
20
21
22
..
40
to an array @array = (19, 20, ... 40)
-- Thanks (27 Replies)
Discussion started by: meghana
27 Replies
10. Shell Programming and Scripting
I have to add a variable value to an array, something like this:
......
@my_array_name = $value_of_this_variable;
This doesnt seem to work, any ideas why?
Thanks! (4 Replies)
Discussion started by: looza
4 Replies