Hi
I need to pass a date argument with my shell script. Can any one send me code for the same.
eg For 15th Aug 2006. Iwant to pass parameter like this
./startenv.sh 08/15/2006.
Everyday date argument must change. Will the below code work ?
./startenv.sh date '+%m/%d/%y'
THanks... (1 Reply)
Hi All,
I have a crontab entry for every 5 min running.
5 * * * * /tmp/scripts/ksh/CsVues_H.sh `date +%Y%m%d_%H` >> /tmp/scripts/ksh/Cronresult.log
and I am passing the date parameter. ( `date +%Y%m%d_%H` )
But the parameter values which i am expecting inside the script is... (6 Replies)
I am following the tread number 81556 to grep a file and send the results in email.
#/bin/bash
/bin/grep -i 'invite sip' /var/log/asterisk/full
if echo "found" |
mail -s 'invite sip' mail@gmail.com
When I just build it to grep and mail, it works fine. However, the if statement causes... (4 Replies)
Hi,
Anyone can help me on how to solve my problem not getting the actual $DATE saying . Here my scripts;
#!/bin/sh
DATE='20110331'
sftp -oUserKnownHostsFile=/.ssh/known_hosts -oIdentityFile=/.ssh/id_rsa -b /source/transfer.sh server1@sftp.com <<EOF
#tranfer.sh
put... (3 Replies)
Im trying to pass curl a list of arguments... one of which is a date... When I run from the command line it works fine but when i try to run the same from a script passing variables it reformats the date for some reason and doesn't work. Example:
curlstring=xxxxxxxxxxx.xxx.xxx:8090/csv/... (1 Reply)
Dear Friends,
I need your help once again.
I have a flat file from which I have grepped something and kept in a separate file for some reason. I want to replace these grepped srtings with the strings in another file.
E.g.
Actual_file.txt
COLOR: 33179 Lakme SEPT2011
Lot No: BR25324
... (5 Replies)
Hi All....
I need to pass date into awk and parse logfile based on that.... i used both awk and /usr/xpg4/bin/awk... both are throwing up error.....
So here is the stuff...
when i use /usr/xpg4/bin/awk :
DATE=`date '+%Y %b %d'`
START=00
END=23
/usr/xpg4/bin/awk -v DATE={"$DATE"} -v... (3 Replies)
I want get a number(ID) from a sentence which has been grepped from file using error number.
For Example:
#!/bin/ksh
echo "Enter RRS ID: "
read rrs
echo "Enter error number:"
read err
scp -pr ptc-avdbamdw102:/home/icsprd/M3logs/Accurate/logs/corp_post/$rrs.*.err.txt $HOME/daemon_mail/... (7 Replies)
Greetings all,
If I have a SH script that calls a PERL script in the following way:
perl $HOME/scripts/config.properties
And in the config.properties PERL file, this Perl script only sets a number of environmental parameters in the following way:
#!/usr/bin/perl
$VAR1 = (
... (3 Replies)
We have C shell and we are executing the below script:
#!/bin/csh -f
if ($#argv != 2) then
echo "Usage $0 DirecotryPath Inputfilename"
exit 1
endif
set dir=$1
set fname=$2
echo $dir
foreach line ( `cat $fname` )
echo \ ======================================== >>... (2 Replies)
Discussion started by: donisback
2 Replies
LEARN ABOUT LINUX
autolog
AUTOLOG(8) System Manager's Manual AUTOLOG(8)NAME
autolog - Log out idle users
SYNOPSIS
autolog [ options ]
DESCRIPTION
The program reads the utmp file, entry by entry. The username for each 'user process' is compared to the entries in the configuration file
(see autolog.conf(5) ). The first entry to match both the name, the group, and the tty line of the process will be used to conduct the
automatic logout.
CALL
/etc/init.d/autolog start
or
autolog
to run this program in daemon-mode
autolog -o
to run this program as "ordinary" program. Keep in mind: Also when running as ordinary program, it will stay in memory until all
its jobs are done.
OPTIONS -a (all processes) Print information on ALL utmp entries--not just user processes.
-d (debug mode) This is helpful in setting up your configuration file. The program runs in foreground rather than forking and it
prints out verbose messages about what it is doing.
-n (nokill) Use this to prevent autolog from actually "killing" anyone. Use -d and -n together when setting up a new configuration
file. ( This will not affect killing of lost processes. )
-o (ordinary) Use this to run this program as ordinary program, not as daemon. Program will end, when its job is done. In this case,
some data is kept in "/var/lib/autolog/autolog.data". This is read, when the program is called again.
-f config_file_name
Use this to override the default: "/etc/autolog.conf"
-l log_file_name
Use this to override the default: "/var/log/autolog.log". Note that if this file doesn't exist, no logging will happen. Create the
file (with touch) to enable logging.
-t idle_time
Use this to override the internal default idle time (minutes)
-g grace_period
Use this to override the internal default grace period (seconds)
-m yes/no
Use this to override the internal mailing switch. If "yes" the program will send mail to the users right after killing them.
-c yes/no
Use this to override the internal "pre-clear" switch. If "yes" the program will clear the terminal screen before warning the user.
-w yes/no
Do timeouts based on total session time--not idle time. (hard)
-l yes/no
If set to "yes" activities will be written to the logfile if present.
AUTHOR
Kyle Bateman <kyle@actarg.com> (autolog 0.35),
Carsten Juerges <juerges@cip-bau.uni-hannover.de>
(autolog 0.40)
This manual page was modified for Debian by Paul Telford <pxt@debian.org>
Linux Administrative Utilities AUTOLOG(8)