10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I create a CGI in bash/html.
My awk script looks like :
echo "<table>"
for fn in /var/www/cgi-bin/LPAR_MAP/*;
do
echo "<td>"
echo "<PRE>"
awk -F',|;' -v test="$test" '
NR==1 {
split(FILENAME ,a,"");
}
$0 ~ test {
if(!header++){
... (12 Replies)
Discussion started by: Tim2424
12 Replies
2. Shell Programming and Scripting
I really can't figure this one out.
I have 2 files, one file is a list of hostnames and the other is a list of their corresponding IPs:
fileA:
example.com
another.org
thirdie.net
fileB:
1.1.1.1
2.2.2.2
3.3.3.3
I want to create a fileC that looks like:
example.com 1.1.1.1... (2 Replies)
Discussion started by: zstar
2 Replies
3. Shell Programming and Scripting
Hi,
I have a file called "readfile" it contains below parameters
#cat readfile
word=/abc=225,/abc/cba=150 three=12 four=45 five=/xyz/yza
likewise multiple line.
From the above file, I have to read "word"
output should be like,
/abc
/abc/cba
these values need to be put in... (3 Replies)
Discussion started by: munna_dude
3 Replies
4. Shell Programming and Scripting
Hi everyone,
Please some help over here.
I've written the below script using ranges (/Initial_pattern/,/Final_Pattern/)to extract only those lines of interest for me:
awk '
/^Category/,/^$/{print $1};
/Titles/,/^$/{print $1};
/Authors/,/^$/{print $1}' inputfile
To process this input:... (8 Replies)
Discussion started by: cgkmal
8 Replies
5. Shell Programming and Scripting
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Discussion started by: jimmy_y
0 Replies
6. Shell Programming and Scripting
I have files that store multiple data points for the same device "vertically" and include multiple devices. It repeats a consistant pattern of lines where for each line:
Column 1 is a common number for the entire file and all devices in that file
Column 2 is a unique device number
Column 3 is... (7 Replies)
Discussion started by: STN
7 Replies
7. Shell Programming and Scripting
Hi,
using awk /sed, I need to sort out the input file.
here is the example
input file===
Name= shashi | country= india | region = asia | dept= ww
Name= jon | region = asia | dept= xx
Name=sam | dept= ww
Name= anthony | country=england | dept= xx
Name= sumo | country= china
output... (3 Replies)
Discussion started by: hegdeshashi
3 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
I have a file which contains comments,dotted lines(-------),actual records etc.I need to fetch only the actual records and put into a new file neglecting/deleting other rows.I have a header record too which contains the column names for the actual records.i need to discard this too.how... (5 Replies)
Discussion started by: ganesh_248
5 Replies
9. Shell Programming and Scripting
Hello, I have a script that generates the following file named /tmp/rfkill:
rf55 pts/13 Jul 10 06:38 (10.72.11.44)
15782 pts/13 5:07 b
rf56 pts/15 Jul 10 06:53 (10.72.11.9)
18552 pts/15 0:28 b
rf55 pts/39 Jul 10 09:12 (10.72.11.44)
19354 pts/39... (4 Replies)
Discussion started by: raidzero
4 Replies
10. Shell Programming and Scripting
I have a file that contains the following lines
the brown quick fox
jumped over
the white laze dog
0123456789
I wanted to put the contents of this file into a variable so I used this code:
VAR_LIST=`cat $2`
where $2 is the file name passed as an argument to the script
If I... (3 Replies)
Discussion started by: Nomaad
3 Replies