10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
ignore the simplicity of the foo file, my actual file is much more hardcore but this should give you the jist of it. need to combine the two awks into one liner. essentially, need to return the value of one particular field in a file that has multiple comma separated fields. thanks guys
cat foo... (1 Reply)
Discussion started by: jack.bauer
1 Replies
2. Shell Programming and Scripting
I am new for Perl I want to ask one question. I have around 50 custom packages which i am using in my Perl script. I want to import all .pm packages in my Perl script in an easy way. Right now i have to import each package individually. So Is there any way to do so??
Right Now i am doing like:
... (1 Reply)
Discussion started by: Navrattan Bansa
1 Replies
3. UNIX for Dummies Questions & Answers
hi,
I have a directory "test" under which there are 3 files a.txt,b.txt and c.txt.
I need to rename those files to a.pl,b.pl and c.pl respectively.
is it possible to achieve this in a sed or awk one liner?
i have searched but many of them are scripts.
I need to do this in a one liner.
I... (2 Replies)
Discussion started by: pandeesh
2 Replies
4. Shell Programming and Scripting
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Discussion started by: verge
9 Replies
5. Shell Programming and Scripting
I would like to print result of multiple search pattern invoked from an one liner. The code looks like this but won't work
gawk -F '{{if ($0 ~ /pattern1/) pat1=$1 && if ($0 ~ /pattern2/) pat2=$2} ; print pat1, pat2}'
Can anybody help getting the right code? (10 Replies)
Discussion started by: sdf
10 Replies
6. Shell Programming and Scripting
Hi
I am trying to search and replace a multi line pattern in a php file using awk.
The pattern starts with
<div id="navbar">
and ends with
</div>
and spans over an unknown number of lines.
I need the command to be a one liner.
I use the "record separator" like this :
awk -v... (8 Replies)
Discussion started by: louisJ
8 Replies
7. UNIX for Dummies Questions & Answers
Okay so here's something that's confusing me: I have a script that's designed to remove the words "new_" from the front of any file except two exceptions and it looks something like this...
for i in new_*
do
if ] && ]; then
j=`echo "$i"|cut -c5-`
mv $i $j
fi
done
... (5 Replies)
Discussion started by: Korn0474
5 Replies
8. Shell Programming and Scripting
Using these 2 comands to concatenate both outputs into single file:
cat testdata | awk 'BEGIN { FS="\n"; RS=""; } /<pattern1>/ {print}' > testdata1
cat testdata| awk '/<pattern2>/,EOF' >> testdata1
is it possible to combine both "awk" into 1-liner?
pls advise and thanks in advance. (5 Replies)
Discussion started by: ux4me
5 Replies
9. UNIX for Dummies Questions & Answers
i have two commands
ls -l > aaaa
tr < aaaa
It give the out put :-
TOTAL 16
-RW-R--R-- 1 SUBHO NONE 0 JUL 22 2009 AAAA
DRWXR-XR-X 2 SUBHO NONE 0 JUL 22 20:55 DD
-RW-R--R-- 1 SUBHO NONE 0 JUL 22 20:55 DDD
-RW-R--R-- 1 SUBHO NONE 28 JUL 22 18:01 FF
-RW-R--R-- 1 SUBHO NONE 93 JUL 22... (6 Replies)
Discussion started by: subhotech
6 Replies
10. Shell Programming and Scripting
Hi there,
I was wondering if someone can help me with this.
I am trying the combine multiple columns from multiple files into one file.
Example file 1:
c0t0d0 c0t2d0 # hostname vgname
c0t0d1 c0t2d1 # hostname vgname
c0t0d2 c0t2d2 # hostname vgname
c0t1d0 c0t3d0 # hostname vgname1... (5 Replies)
Discussion started by: martva
5 Replies