10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi, Below command is working as expected, but would like to know how to club the two AWK scripts in the command into one
echo -e "MMS000101S0203430A|20180412E|\nMMB0001INVESTMENT||107-86193-01-03|\nMMB0001FUND||107-86193-04-01|\nMMC9991 " | awk -F'|' -v OFS=, '/^MMC9991/{print r"|"s,t; next}... (3 Replies)
Discussion started by: JSKOBS
3 Replies
2. 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
3. UNIX for Dummies Questions & Answers
Hi,
I have the following two awk statements which I'd like to consolidate into one by piping the output from the first into the second awk statement (rather than having to write kat.txt out to a file and then reading back in).
awk 'BEGIN {FS=OFS=" "} {printf("%s ", $2);for (x=7; x<=10;... (3 Replies)
Discussion started by: kasan0
3 Replies
4. Shell Programming and Scripting
I've written a script:
find -depth | awk ‘
{
if ( substr($1,length($0)-2,3) == “/1.” )
{ print $1 }
{ system(“awk -f test1.awk “ $1 ) }
}
‘
The idea is that it trundles through a large directory structure looking for files which are named '1.' and then... (3 Replies)
Discussion started by: nashcom
3 Replies
5. 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
6. Shell Programming and Scripting
I need to combine two scripts, into one script. One is to delete something, the to recreate. Here is the scripts:
BIN=/usr/lbin
LINE='device for 0101a01: lpd://172.25.41.111:515'
while read LINE
do
prt=`echo $LINE | awk '{print $3 }'| cut -c 1-7`
echo $prt
#drv=`echo $LINE | awk -F":"... (4 Replies)
Discussion started by: ggoliath
4 Replies
7. Shell Programming and Scripting
Hello experts,
I have separate scripts (KSH) each for Solaris and AIX to install core applications (e.g. BigBrother). I also have a script called Installer that gives a menu list to select a particular application to install from a bunch of applications.
Now I am trying to combine separate... (7 Replies)
Discussion started by: solaix14
7 Replies
8. UNIX for Dummies Questions & Answers
Hello
How do I combine the following 2 codes in one, the purpose is to not generate the outfile1
awk '{print $9 "\t" $10 "\t" $11}' infile > outfile1
awk '{ gsub(/.fa/,""); print }' outfile1 > outfile2
Thanks
Joseph (2 Replies)
Discussion started by: jdhahbi
2 Replies
9. Shell Programming and Scripting
Hi,
I have 5 files basically;namely file1.txt situated each at folder A to E respectively.
I would like to extract out third column from each of these file1.txt from folder A to folder E. Also, I wanted to extract the first and second column which are common. In other words, e.g
... (6 Replies)
Discussion started by: ahjiefreak
6 Replies
10. Shell Programming and Scripting
Hello All,
I have a problem in executing the following - I have a monitor.sh that kicks off and then the config.sh which sends message to the monitor.sh. So If I recieve a Failed message, the monitor.sh will kill the config.sh process and outputs a message.
monitor.sh:
message= FAILED... (3 Replies)
Discussion started by: chiru_h
3 Replies