03-20-2015
It skips 2 lines of the input file "result.txt" and then prints the first field and the fourth, if not empty, or the second, if fourth ist empty/non existant.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I try to use the unix commands inside awk and couldnt succeed .
Please help me how to achieve it.
Regards,
Sukumar. (7 Replies)
Discussion started by: jerome Sukumar
7 Replies
2. Shell Programming and Scripting
what does this mean?
cat /etc/passwd | awk -F: '{print $5}' | \
awk -F, '{print $1}' | \
awk '{print tolower($l)};{print tolower($2)}' | \
grep -v '^$' >> local_tmp (1 Reply)
Discussion started by: hin-linux
1 Replies
3. Shell Programming and Scripting
Hi,
I have a scenario where in, I have a file named abc.txt.
I extract the file names from it using.
awk '/dbf$/{print $NF}' abc.txt
/u01/oradata/omc/systab/omcdef.dbf
/u01/oradata/omc/oratemp/temptab1.dbf
Now I need to further enhance this command and also extract the mount point... (3 Replies)
Discussion started by: geetap
3 Replies
4. UNIX for Dummies Questions & Answers
Hi, I have 2 lists of words and I need to take every line in first_list.txt and use agrep command to find similar words in whole second_list.txt.
I tried to use AWK, but I dont know how to take current line ($0) and use in inside of agrep
cat first_list.txt | awk ''
Thanks for help (10 Replies)
Discussion started by: m4rty
10 Replies
5. Shell Programming and Scripting
Hi,
I've searched this site and the wider web and have not found anything (that I can understand..) that helps me.
I've used shell commands in awk fine in the past, the difference is that I want to pass the shell command a field variable within awk from the current input.
A simple example... (3 Replies)
Discussion started by: Ronnie717
3 Replies
6. Shell Programming and Scripting
I want to create an awk script that performs different things on different files.
For example, for files with extension .ry I might do something, but for .xt I do something else, and another things on .zc files.
How can I do this in one awk script? (3 Replies)
Discussion started by: kristinu
3 Replies
7. UNIX for Dummies Questions & Answers
Hey guys i want to use shell commands like ls, find, cd and more with in awk statements with inputs from the awk variables.
Like in the below code how can i change the directory using the value of path. Please suggest
awk '{ while (i<NR)
{
i++;
percentage = $5;
path = $6;
... (2 Replies)
Discussion started by: rishi90
2 Replies
8. 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
9. 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
10. Shell Programming and Scripting
I have developed a bash shell script which works perfectly fine when any bash shell is in use except SunOS.
There are two commands that is not compatible.
#!/usr/bin/env bash
Problem
1. The awk command below does not work for SunOS
Requirement
We extract Oracle EBS tables into text... (9 Replies)
Discussion started by: uuuunnnn
9 Replies
LEARN ABOUT NETBSD
passwd.nntp
PASSWD.NNTP(5) File Formats Manual PASSWD.NNTP(5)
NAME
passwd.nntp - passwords for connecting to remote NNTP servers
DESCRIPTION
The file /etc/news/passwd.nntp contains host-name-password triplets for use when authenticating client programs to NNTP servers. This file
is normally interpreted by the NNTPsendpassword routine in libinn(3). Blank lines and lines beginning with a number sign (``#'') are
ignored. All other lines should consist of three or four fields separated by colons:
host:name:password
host:name:password:style
The first field is the name of a host, and is matched in a case-insensitive manner. The second field is a user name, and the third is a
password. The optional fourth field specifies the type of authentication to use. The default is ``authinfo'' which means that NNTP
``authinfo'' commands are used to authenticate to the remote host. If either the username or password are empty, then the related command
will not be sent. (The ``authinfo'' command is a common extension to RFC 977.)
For example:
## UUNET needs a password, MIT doesn't.
mit.edu:bbn::authinfo
uunet.uu.net:bbn:yoyoma:authinfo
This file should not be world-readable.
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.14, dated 1996/09/06.
SEE ALSO
innd(8), libinn(3).
PASSWD.NNTP(5)