Help making simple perl or bash script to create a simple matrix
Hello all!
This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician.
Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix:
Can anyone direct me to a resource that explains scripting in simple terms?
I have visited many sites and browsed this forum and have yet to find simple explanations. (8 Replies)
Hi
I want to write a small script that will create folders named from `AAAA' all the way to `ZZZZ'.
That is:
`AAAA'
`AAAB'
`AAAC'
...
`AABA'
`AABB'
`AABC'
...
`ABAA'
`ABAB'
`ABAC'
...
`ABBA'
...
`ZZZZ' (4 Replies)
I have a local account for a unix server. The idle timeout for the account is around 10 mins. I have to login to the server multiple times during the day. Is there a way to increase the idle timeout or may be a script that I can run on background so it is not idle. Something like echo date every 9... (3 Replies)
I'm attempting to parse a file whose contents follow this format;
4:/eula.1028.txt:
8:/eula.1031.txt:
19:/eula.1033.txt:
23:/eula.1036.txt:
27:/eula.1040.txt:
31:/eula.1041.txt:
35:/eula.1042.txt:
39:/eula.2052.txt:
43:/eula.3082.txt:
The number of lines of the file... (4 Replies)
Guys I want to do this:
copy:
/var/router/system1/config/backup/install.put
/var/router/system2/config/backup/install.put
/var/router/system3/config/backup/install.put
/var/router/system4/config/backup/install.put
into:
/var/router/system1/config/install.dat... (22 Replies)
Dear all,
I have a directory named A and some subdirectories named B, C, D with .xml files. I want to use the following command to strip the file.
sed -re ':start s/<*>//g; /</ {N; b start}' file.xml > file.xml
At the same time, I want to remove the blank lines using
sed '/^$/d'
How can... (6 Replies)
This is the problem: Write a script that will make a backup of a file giving it a ‘.bak’ extension & verify that it works. I have tried a number of different scripts that haven't worked and I haven't seen anything really concise and to the point via google. For brevity's sake this is one of the... (4 Replies)
Hello,
Anyone please covert this in perl language
########################
if ps faux | grep -v grep | grep ProcessXYZ
then
echo "$SERVICE is running, , everything is fine"
exit 0
else
echo "$SERVICE is not running"
exit 2
fi
Additional... (1 Reply)
I am trying to make a 4x4 matrix and I would greatly appreciate any help.
I have 4 text files and I want to do the following. I want to concatenate them and gzip them. Then I want to find the file size of the concatenated file and subtract the value of file A. Finally, I want to output this final... (1 Reply)
Discussion started by: sdw8253
1 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)