06-15-2009
Thanks guys both reply works fine.once again thanks a lot for your help.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
cat .servers | while read LINE; do
ssh jason@$LINE $1
done
exit 1
./command.ksh "ls -l ~jason"
Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing?
Thanks!
JP (2 Replies)
Discussion started by: jpeery
2 Replies
2. Shell Programming and Scripting
Hello
I' m confused a bit.
I want to replace string "&" with "&" using this command.
sed 's/&/&/g'
and it doesn't work. Nothing happens.
On the other side this works:
sed 's/&/@/g'
or sed 's/&/^/g' !!!
Can somebody help please?
Thanks (3 Replies)
Discussion started by: billy5
3 Replies
3. UNIX for Dummies Questions & Answers
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies
4. Shell Programming and Scripting
If there exists a field in stdin, print it, otherwise, print hello.....
These print nothing:
cat /dev/null | awk '{if ( length > 0 ) print $1; else print "hello"}'
cat /dev/null | awk '{if ( $1 ) print $1; else print "hello"}'But the scripts work if I run them directly in a terminal:
... (8 Replies)
Discussion started by: ksheller
8 Replies
5. Shell Programming and Scripting
I have a folder that I need to search for new files and copy on the latest. I've been using "-mtime -1" in my command line but it doesn't seem to work.
I've been meaning to fine a different script because files are dropped into the folder all day long and because of the -mtime, I've only be... (19 Replies)
Discussion started by: bbbngowc
19 Replies
6. Shell Programming and Scripting
Hi,when I run my first shell script,I got something that doesn't work right.
I wrote this code in the script.
echo -e "Hello,World\a\n"But the screen print like this:
-e Hello,World
The "-e" wasn't supposed to be printed out.
Can anyone help me out?:wall:
Many thanks!:) (25 Replies)
Discussion started by: Demon
25 Replies
7. Shell Programming and Scripting
I have the following and for some reason I can't have two options together.
I mean if I choose -u and -p it won't work... why?
#!/bin/bash
resetTime=1
mytotalTime=0
totalHour=0
totalMin=0
averagemem=0
finalaverage=0
times=0
function usage()
{
cat << EOF
USAGE: $0 file
EOF
} (10 Replies)
Discussion started by: bashily
10 Replies
8. UNIX for Dummies Questions & Answers
find . -name "05_scripts" -type d -exec mv -f {}/'*.aep\ Logs' {}/.LogFiles \;
Returns this failure:
mv: rename ./019_0120_WS_WH_gate_insideTEST/05_scripts/*.aep\ Logs to ./019_0120_WS_WH_gate_insideTEST/05_scripts/.LogFiles/*.aep\ Logs: No such file or directory
I don't know why it's trying... (4 Replies)
Discussion started by: scribling
4 Replies
9. Shell Programming and Scripting
Hi,
I am using korn shell.
until ]
do
echo "\$# = " $#
echo "$1"
shift
done
To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work.
Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies
10. Shell Programming and Scripting
#!/bin/sh
trap "cleanup" TERM
timeout=5
mainpid=$$
cleanup()
{
echo "at $i interupt"
kill -9 0
}
watchdog()
{
sleep $1
}
(watchdog $timeout && kill -TERM $mainpid) &
run_test() (10 Replies)
Discussion started by: yanglei_fage
10 Replies
ZAWAY(1) General Commands Manual ZAWAY(1)
NAME
zaway - tell other people via Zephyr that you aren't around
SYNOPSIS
zaway [ OPTIONS ] [ FILE ]
DESCRIPTION
zaway provides a way for you to automatically send replies when other people contact you using zwrite(1). zaway subscribes itself to class
"MESSAGE", instance "*", so that it can monitor your incoming messages. It does not affect the operation of any other client receiving
messages. zaway is typically run when you are leaving your terminal or display temporarily. zaway usually never exits; when you return to
your terminal you should type the interrupt character (usually ^C) in order to make zaway exit.
OPTIONS
-m STRING
Use STRING as the body of the auto-reply message. Any message file (specified on the command line or the default) is ignored.
-w Watch the invoking user's location status. If the user is locatable anywhere, no auto-replies will be sent.
-h Displays a short usage message and exits.
zaway uses a message file (which defaults to $HOME/.away) to describe what reponses should be sent to which senders. The general format of
this file is:
>name
>name
message
>name
message
Any number of user names may be specified preceding the message to send to those senders. If a user name appears more than once, the mes-
sage will be a concatenation of each of the appropriate messages. There are two special names: "*" indicates that the following message
should be sent to all senders and "%" indicates that the following message should only be sent if the user name has not matched yet.
If no file is specified, and no default file can be found, the following message is returned:
I'm sorry, but I am currently away from the terminal and am not able to receive your message.
If a user name does not match any of those listed in the file, and no "*" or "%" field is specified, no return message is sent. All mes-
sages are preceded by a signature "Automated reply:". To avoid loops, messages are not sent in response to messages beginning with an
"Automated reply:" signature or sent by the same Kerberos principal as the user running zaway.
SAMPLE FILE
>eichin
>tony
Hi there guys! I'm in the other room right now.
I'll be back in 5 minutes or so.
>jruser
Sorry, but I'm gone for the day...
>%
Hello...I'm not sure who you are. I'll be back soon,
though.
>*
This message comes to you compliments of zaway!
The final "compliments" message will be included in all messages, whereas the "I'm not sure" message will only be included in messages that
are not from "eichin", "tony", or "jruser".
FILES
$HOME/.away
SEE ALSO
zephyr(1), zwgc(1), zwrite(1), zhm(8), zephyrd(8)
Project Athena Technical Plan Section E.4.1, `Zephyr Notification Service'
AUTHOR
Robert S. French (MIT-Project Athena)
RESTRICTIONS
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology. All Rights Reserved.
zephyr(1) specifies the terms and conditions for redistribution.
MIT Project Athena July 1, 1988 ZAWAY(1)