9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Since output of w command have variable number of columns I want to get the output in pipe delimited format. I tried
export OFS="|"; w
but that does not work.
Any ideas? (4 Replies)
Discussion started by: Soham
4 Replies
2. SuSE
Hi,
I am using below code snippet to echo/display the files found
(matching a pattern from searchstring.out file) and the corresponding owner.
while read j
do
echo "Pattern to search is:- $j"
find / -name "*$j*" |\
while read k
do
echo "File found is:- $k"
owner=$(ls... (9 Replies)
Discussion started by: Vipin Batra
9 Replies
3. Shell Programming and Scripting
Hi Team,
Need a help on how to pipe a command out put to a shell script. My shell script looks like below.
cat shell_script
#!/usr/bin/ksh
input =$@
echo " we are inside the shell script"
echo " here are the input parameters"
..........................
..................
... (11 Replies)
Discussion started by: gvkumar25
11 Replies
4. Shell Programming and Scripting
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies
5. Shell Programming and Scripting
xargs work great when a command gives multiple line output which can be input to another. In my case it is not working coz the second command uses two words in it.
$ scr.sh
gives output like
193740
638102
375449
..
..
another command takes these number as inputs. it works great... (1 Reply)
Discussion started by: mahesh113
1 Replies
6. Shell Programming and Scripting
Hi All,
i have the following command
df|awk '{print $5}'|grep /| egrep -v '^/$|/usr|/opt|/var/log|/home|/tmp'
output looks like:
/filesystem/number1
/filesystem/number2
/filesystem3
/possiblymoreoutput
i want the output to look like the below (either in a file or to output to... (3 Replies)
Discussion started by: Tommyk
3 Replies
7. UNIX for Dummies Questions & Answers
I can use pipe output to a file. For example
./somescript.sh > output.txt
But for example if the output from ./somescript.sh is slow. like if it prints one line every minute then output.txt is not updated every minute. Lines are written to output.txt in one go, hence have to wait for the whole... (2 Replies)
Discussion started by: kevincobain2000
2 Replies
8. Shell Programming and Scripting
Hi ,
I would like to assign command (with pipe) output to a variable. The code is as follows. The goal of the code is to get the last folder folder with a particular name pattern.
myDate=`ls | grep 2009 | tail -1`
echo "myDate=" $myDate
However, in the presence of the pipe, the code... (3 Replies)
Discussion started by: jeff_cen
3 Replies
9. UNIX for Dummies Questions & Answers
i want to redirect output of one command as the command line argument of another script
for example, say i would run this command:
find . -xdev -type f -size +4096 -exec ls -al {} \;
i wan to be able to do something like:
echo +4096 | find . -xdev -type f -size ****** -exec... (3 Replies)
Discussion started by: IMTheNachoMan
3 Replies