You will need to change 1st line to #!/bin/bash to avoid sh-compatibie mode
things get better, but I find if I change the "sleep 1" to "sleep 100", after 5s, it doesn't kill the "sleep 100", and looks it doesn't kill the mainpid too, so the cleanup doesn't execute.
BTW, can you explain the usage you offered, thanks
Last edited by yanglei_fage; 07-08-2015 at 03:50 AM..
Bash and dash not work but ksh93 can do it.
Problem is pipe = how to do it.
Difference is how to think about pipe: like you think it = "programmer way" = ksh (88+93) or works it like it has defined, own process = bash, posix, dash, ... = you kill the pipe 1st process.
command line is process to kill (=ksh) or current process kill (bourne shell, bash, dash,...).
The best example is pipe and read. I don't say which works correctly, because both works as they has planned. But I like more David Korn way to think about it. It use shared mem between piped subprocess = sub process create variable and I can use it in the parent process.
All other shells you need to use io redirection, then it's same process, works also in ksh:
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)
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)
# uname -a
Linux localhost.localdomain 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
# useradd 4141421248
useradd: invalid user name '4141421248'
why??? (6 Replies)
Hi,
I need to use remsh inside a ksh script. The script would remsh to another machine (maybe different OS) and then execute commands.
A Simple Script:
#!/usr/bin/ksh
remsh sun7656 -l myuser "cd /user.3/MyFolder; ls -lart"
But this gives me the error:
permission denied
I also... (4 Replies)
hi
I wrote the following makefile, I have just one problem, when i type make clean I get the message make 'clean' is up to date and any obj file is removed from my folder, what's wrong?
Thank you
CC = cc
all: es.o elaboration.o
$(CC) -o es es.o elaboration.o
elaboration.o:... (0 Replies)
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)
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)
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)