11-22-2008
The script is -
#!/cygdrive/c/Perl/bin/perl
$var=3 ;
printf $var;
@list=(1,2,3);
printf "@list";
---------------------------
the error i get in cygwin is -
bash: =
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to run the following code from a script file but it complains that syntax of (both instances of) grep is wrong.
When I copy and paste it to the terminal, it is OK. Any idea what the problem might be?
set i = `grep -c #define flags.h`
while ($i>20)
@ i--
my func (`cat... (4 Replies)
Discussion started by: barisgultekin
4 Replies
2. UNIX for Dummies Questions & Answers
without using ls, just using echo so purely pattern matching
I can say echo */ <-- lists directories
but how would I match files? surely something like *!/ or * but neither work ?
it seems like there isn't much that I can put in but surely i should be able to put any ascii... (1 Reply)
Discussion started by: james hanley
1 Replies
3. Shell Programming and Scripting
#!/bin/sh
something(){
echo "Inside something"
echo $1 $2
}
val=$(something "Hello " "world")
Output expected:
Inside somethingHello world
But it's not echoing. (4 Replies)
Discussion started by: cola
4 Replies
4. Ubuntu
completion-ignore-case option doesn't work in my version:
/home/user $ echo $BASH_VERSION
3.2.48(1)-release
/home/user $ ls -l *
-rw-r--r-- 1 user user 0 2009-10-18 00:09 somefile
-rw-r--r-- 1 user user 0 2009-10-18 00:09 Somefile
/home/user $ set completion-ignore-case on
But when I... (2 Replies)
Discussion started by: Sapfeer
2 Replies
5. Shell Programming and Scripting
I am writing perl script to configure Cisco device but Variables inside Net::Telnet::Cisco Module doesn't work and passed to device without resolving.
Please advise.
here is a sample of script:
use Net::Telnet::Cisco;
$device = "10.14.199.1";
($o1, $o2, $o3, $o4) = split(/\./,$device);... (5 Replies)
Discussion started by: ahmed_zaher
5 Replies
6. Shell Programming and Scripting
Hi,
I'm trying to write a script that checks gvfs to see if a mount exists so I can run it from network-manager's status hooks. I thought I'd pipe the output of gvfs-mount -l to grep for the particular mounts I care about. When I do this in a bash script:
cmnd="gvfs-mount -l | grep -i... (4 Replies)
Discussion started by: kcstrom
4 Replies
7. Shell Programming and Scripting
Hello Friends,
My bash script is like this
#!/bin/bash
# request Bourne shell as shell for job
#$ -S /bin/bash
# assume current working directory as paths
#$ -cwd
#$ -N rsync-copy
#
# print date and time
date
rsync -rltD --progress "ssh -i /home/myname/.ssh/id_rsa"... (4 Replies)
Discussion started by: jacobs.smith
4 Replies
8. UNIX for Beginners Questions & Answers
Hi everyone,
I've an issue trying to soustracte two dates, e.g:
d1=$(date -d "Nov 18, 2017" +%s)
d2=$(date +%s) # Today we are 2017-11-16
echo "$(( (d1 - d2) / 86400 ))"
Output:
1
I don't understand why it doesn't work. for me, it should give "18 - 16 = 2".
Much appreciated... (1 Reply)
Discussion started by: Arnaudh78
1 Replies
9. Shell Programming and Scripting
Bash version 4.4.20 / Ubuntu 16.0.4
Hello,
I tried to write a script that gathers some data and passes them to an executable.
The executed application answers with an error. The echo output in the script returns correct values.
If I copy/paste the last echo command, it get's executed... (2 Replies)
Discussion started by: sushi2k7
2 Replies
10. UNIX for Beginners Questions & Answers
I have the following code:
#!/bin/csh
clear
set cloud_file="/home/labs/koren/davidsr/general_scripts/MFP_10_PP_Parmas.txt" # to fill
set mie_tables_dir='/home/labs/koren/davidsr/SHDOM_MAIN/MIE_TABLES/non_polo_wave_0.7_water_50R_s0.5_e25_max_70.mie' # to fill
set prp_dir='${pp_dir}/pp_prp/'... (2 Replies)
Discussion started by: student_wiz
2 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)