10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
so i have scripts that are piped and then run through one of the following mechanisms:
cat myscript.sh | sh
cat myscript.pl | perl
what i want to do is, after either of the above commands are run, if the output from the command contains a certain string, i want it to avoid printing... (3 Replies)
Discussion started by: SkySmart
3 Replies
2. Shell Programming and Scripting
Hi,
Can anyone help me how to exit a shell script if a unix command inside does not return any value for 10 seconds?
The scenarios is like this.
I want to login to a application using shell script where the connection string is mentioned.but suppose this connection string is not... (10 Replies)
Discussion started by: arijitsaha
10 Replies
3. Shell Programming and Scripting
Hi..
i have a file ABC_*.txt in source directory which will come evry 30 min and same file will be moved to working directory first time ...and will perform some operations then we archive ABC_*.txt ..this will run for 30 min to 45 min
from 2nd time onwards requirement is ...i need to check... (3 Replies)
Discussion started by: dssyadav
3 Replies
4. Shell Programming and Scripting
Hi
I have a little problem with the find command in a script that I'm writing. The script should check if there are some files younger than 100 seconds and then syncronise them with rsync.
My find command:
find -type f -cmin -100 -exec rsync -a --delete directory1/ directory2/
When I... (8 Replies)
Discussion started by: oku
8 Replies
5. Shell Programming and Scripting
Hi,
I am using /bin/sh. I want to display the stdout and stderr on the terminal as well as save it in a file, so I'm using this command.
gmake all 2>&1 | tee log
But even if gmake fails, it's always giving 0 as exit status, i suppose because of tee.
# false 2>&1 | tee Log
# echo $?
0... (2 Replies)
Discussion started by: anand_bh
2 Replies
6. Shell Programming and Scripting
Hi All,
I am using the following code to move files from one folder to another on the remote server:
ssh username@server <<EOF
cd source_dir
find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir
if
then send mail indicating error
otherwise
echo "success"
fi
EOF
... (10 Replies)
Discussion started by: visingha
10 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I am using the following code to move files from one folder to another on the remote server:
ssh username@server <<EOF
cd source_dir
find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir
if
then send mail indicating error
otherwise
echo "success"
fi
EOF
... (1 Reply)
Discussion started by: visingha
1 Replies
8. UNIX for Dummies Questions & Answers
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies
9. Shell Programming and Scripting
I have a question about how to get the exit code of the first command when it appears in a pipe-lined command.
For example, I have the following script:
grep abc dddd | tee -a log
if ]
then
echo "ERROR!"
fi
In the above script, ] is supposed to test the exit code of "grep abc... (3 Replies)
Discussion started by: pankai
3 Replies
10. Shell Programming and Scripting
How to find out whether the command I executed is successful or unsuccessful(at commandlinet)
Eg:
say i execute the following command at command line
rm *
How do i find out whether my previous command is a success or failure.
Thankyou.
Best Regards,
Ram. (1 Reply)
Discussion started by: ramky79
1 Replies