04-25-2018
Did my proposal from post #for the new split(1) command fix the issues?
If -F"#[|]#" is still not correcting the issue, can you give us more details on what output / error messages you get when it fails(as requested in post #2).
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. Shell Programming and Scripting
can you please let me know what does the below awk command does.
awk 'NR>2{printf "%-30s %-15s\n", $1, !($4)?$2:$4;}' result.txt (1 Reply)
Discussion started by: ramkumar15
1 Replies
8. 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
9. 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
10. 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
LEARN ABOUT DEBIAN
syslogout
SYSLOGOUT(8) System Manager's Manual SYSLOGOUT(8)
NAME
syslogout - modular centralized shell logout mechanism
DESCRIPTION
syslogout is a generic approach to enable centralized shell logout actions for all users of a given system in a modular and centralized way
mostly aimed at avoiding work for lazy sysadmins. It has only been tested to work with the bash shell.
It basically consists of the small /etc/syslogout shell script which invokes other small shell scripts having a .bash suffix which are con-
tained in the /etc/syslogout.d/ directory. The system administrator can drop in any script he wants without any naming convention other
than that the scripts need to have a .bash suffix to enable automagic sourcing by the /etc/syslogout script.
For shell sessions, the contents of /etc/syslogout.d/" will be sourced by every user at logout if the following lines are present in his
$HOME/.bash_logout:
if [ -f /etc/syslogout ]; then
. /etc/syslogout
fi
If used for X sessions it is advisable to include the former statement into the Xreset script of the X display manager instead to prevent
that closing of an terminal emulator window yields unexpected results in your running X session if your X11 terminal emulator is using a
login shell. Be sure then to run it under the user-id of the X session's user. See the example files in /usr/share/doc/syslogout/ for
illustration.
Users not wanting /etc/syslogout to be sourced for their environment can easily disable it's automatic mechanism. It can be disabled by
simply creating an empty file called $HOME/.nosyslogout in the user's home directory using e.g. the touch(1) command.
Any single configuration file in /etc/syslogout.d/ can simply be overridden by any user by creating a private $HOME/.syslogout.d/ directory
which may contain a user's own version of any configuration file to be sourced instead of the system default. It's names have just to
match exactly the system's default /etc/syslogout.d/ configuration files. Empty versions of these files contained in the $HOME/.syslo-
gout.d/ directory automatically disable sourcing of the system wide version.
Naturally, users can add and include their own private scripts to be automagically executed by /etc/syslogout at logout time.
OPTIONS
There are no options other than those dictated by shell conventions. Anything is defined within the configuration scripts themselves.
SEE ALSO
The README files and configuration examples contained in /usr/share/doc/syslogout/ and the manual page for bash(1), xdm(1x),
xdm.options(5), and wdm(1x). Recommended further reading is everything related with shell programming.
If you need a similar mechanism for executing code at login time check out the related package sysprofile(8) which is a very close compan-
ion to syslogout.
BUGS
syslogout in its current form is mainly restricted to bash(1) syntax. In fact it is actually a rather embarrassing quick and dirty hack
than anything else - but it works. It serves the practical need to enable a centralized bash configuration until something better
becomes available. Your constructive criticism in making this into something better" is very welcome. Before i forget to mention it: we
take patches... ;-)
AUTHOR
syslogout was developed by Paul Seelig <pseelig@debian.org> specifically for the Debian GNU/Linux system. Feel free to port it to and use
it anywhere else under the conditions of either the GNU public license or the BSD license or both. Better yet, please help to make it into
something more worthwhile than it currently is.
SYSLOGOUT(8)