10 More Discussions You Might Find Interesting
1. Linux
Hello,
I have standard loop
while read -r info; do
command $info
done < info
in info text file I have multiple commands each on line that I want to execute. When I used them in console they worked, but not with this loop.
This is one of the commands in info file:
grep... (4 Replies)
Discussion started by: adamlevine
4 Replies
2. Shell Programming and Scripting
What is the correct syntax to pipe or run three awk commands? Basically, using the output of the first awk as input in the second. Then using the output of the second awk in the third. Thank you :).
awk 'FNR==NR {E; next }$3 in E {print $3, $5}' panel_genes.txt RefSeqGene.txt > update.txt |... (3 Replies)
Discussion started by: cmccabe
3 Replies
3. Shell Programming and Scripting
I create commands within a pipe and finally want them to be executed instead of being displayed on the screen. What is the last stage in this pipe? I found by guessing that "ksh" is working, but is this the best to use here?
It boils down to this:
echo "print Hello World!"| kshWhat is the... (15 Replies)
Discussion started by: Cochise
15 Replies
4. AIX
Hello,
Our AIX box has recently been upgraded to TL12 (oslevel -s = 5300-12-04-1119).
Now one of our ksh scripts is returning 1 when writing to a pipe, the command to write to the pipe is:
echo "A" "B" "C" >> /usr/Pipe.Pipe
Anyone have any ideas?
Thanks (2 Replies)
Discussion started by: dendright
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am using the korn shell on Solaris box.
Why does the following 2 commands return different results?
This command returns no results (I already used this command to create a list of files which I moved to an archive directory)
find ????10??_*.dat -type f -mtime +91
However this... (15 Replies)
Discussion started by: stumpy1
15 Replies
6. UNIX for Dummies Questions & Answers
Hi,
While I am using "|" to join multiple commands, I am not getting the return code when there is error in one of the commnads.
Eg:
b=`find /path/a*.out | xargs basename`
if ; then
echo "Error"
fi
if there is error while finding the file or getting the basename, the $? is... (6 Replies)
Discussion started by: new_learner
6 Replies
7. Shell Programming and Scripting
i have to run set of commands
command1
command2
command3
command4
Now Whenever any of these command fails i should quit while capturing error message.
Is there a better way then checking for $? after each command. (1 Reply)
Discussion started by: vickylife
1 Replies
8. Shell Programming and Scripting
hi
i have a file, i am reading line by line and checking a line contains a string ,
`grep "Change state" $LINE`
if
then
echo "The line contains---"
else
echo "The line does not contains---"
i need to check the return code , but i am getting an error
... (4 Replies)
Discussion started by: Satyak
4 Replies
9. Shell Programming and Scripting
I'm trying to do the following:
1) Run a bunch of jobs in the background
2) Determine if any one of them returns with a non-zero exit status
Here's what I've come up with so far:
##########################################
#!/bin/ksh
while } -lt 1024 ]
do
SLEEP_TIME=`expr 1024 -... (2 Replies)
Discussion started by: bergerj3
2 Replies
10. UNIX for Dummies Questions & Answers
I have a Korn shell script that executes a number of commands on a remote server.
Is it possible to feed in the last exit code of the rsh commands (i.e. something like $?) to a variable within the local shell script?
I tried the following:
returncode=$(rsh spns31 ".... (1 Reply)
Discussion started by: bbouch
1 Replies