10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Can someone please guide me how to combine the following two awk calls in one?
I noticed that it is very often situation for me, and I think that it can be replaced with one awk call.
The question is more general, not the exact one.
echo "A B C/D" | awk '{print $3}' | awk -F/ '{print... (4 Replies)
Discussion started by: mirusnet
4 Replies
2. Shell Programming and Scripting
my code:
gawk 'NR>'"${LASTLINENUM}"' && NR<='"${LINEENDNUM}"'' ${LOGFILE} | gawk '{l=$0;} /'"${STRING1}"'/ && /'"${STRING2}"'/ {for (i=NR-'"${BEFOREGLAF}"'; i<=NR+'"${AFTERGLAF}"'; i++) o=i; t++;} END { for(i=1; i<=NR; i++) if (o) print l; print t+=0;}'
i would like to combine this into one... (5 Replies)
Discussion started by: SkySmart
5 Replies
3. UNIX for Dummies Questions & Answers
Thanks in advance for any advice and help.
I have two lists of variables that I want to put into nested for loops.
for x in 1 2 3
do
for y in a b c
do
The output I want is:
filepath/1/ command modified by a
filepath/2/ command modified by b
filepath/3/ command modified by c
To... (10 Replies)
Discussion started by: wheyhamp
10 Replies
4. Shell Programming and Scripting
awk '{a=$0} END {while (NR) print a}' mail.log | awk '/Feb 2/ {print ;exit;}'
first, can this code be combined into one?
what i want this code to do is output every single line it finds up until the last occurrence of "Feb 2".
right now, this code simply outputs one line, and aborts. ... (12 Replies)
Discussion started by: SkySmart
12 Replies
5. Shell Programming and Scripting
Trying to do so
echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies
6. 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
7. Shell Programming and Scripting
readNOW=$(date +"%Y%m%d%H%M")
read readTerminal #input B
terminalc=$readTerminal
echo eqpt_list_QC_$terminalcT_$readNOW
how to get display result it:
eqpt_list_QC_BT_201209121530 (2 Replies)
Discussion started by: ment0smintz
2 Replies
8. Shell Programming and Scripting
Hi Everyone,
awk 'BEGIN{print strftime("%c",1272814948)}' | tr -d '\n'
how to change tr -d '\n' to be part of the awk? means awk this pchoh time, and awk also remove '\n', instead of using "|" to combine "tr" command.
Thanks (2 Replies)
Discussion started by: jimmy_y
2 Replies
9. Shell Programming and Scripting
I have an awk statement that works but I am calling awk twice and I know there has to be a way to combine the two statements into one. The purpose is to pull out just the ip address from loopback1.
cat config.txt | nawk 'BEGIN {FS="\n"}{RS="!"}{if ( $0 ~ "interface loopback1" ) print$4}' | nawk... (5 Replies)
Discussion started by: numele
5 Replies
10. Shell Programming and Scripting
Within one of my scripts, I have variables extracted from parameters list and want to combine some of them in one (lpath). I tried using awk command..... How do I get it? Thank you.
#!/bin/bash
# ## Read paramlist.txt
file='/name1/name2/paramlist.txt'
while read line
do
#
key= echo... (4 Replies)
Discussion started by: Lenora2009
4 Replies