Error in reading the output from command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Error in reading the output from command
# 1  
Old 05-28-2013
Error in reading the output from command

I getting error as test1.sh: syntax error at line 3: `do' unexpected while i was trying to run below code..

What was going wrong here?

Code:
 
find /usr/tmp/SB/reports/ -type f -name *.rdf |read file;do
 echo "Copying $file to /usr/tmp/SB1"
done

# 2  
Old 05-28-2013
You missed the while statement:
Code:
while read ..

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies

2. UNIX for Dummies Questions & Answers

Reading from Screen/Standard Output

Is it possible to read from the screen or standard output? If so, may I know how I can do this? For example, I have an application running which prints out the following on the screen: Starting tools from .image-tools... imagecontrol_1: SECS/GEM-capable version is running done cindy@pgunix... (2 Replies)
Discussion started by: sippingsoda
2 Replies

3. UNIX for Dummies Questions & Answers

Help with reading link output

Hello folks; I have a script uses wget to query a link to get the temperature from sensor then email the results to me. Here's the script: "wget -q http://server/temp -O - | mail -s "Temp Update" moe@ocd.com" normally the output from using wget looks like this: Lab_1|69.8 | ... (8 Replies)
Discussion started by: Katkota
8 Replies

4. Shell Programming and Scripting

Reading PL/SQL output online from perl??

Hi there, I got this situation at job. First i have a Perl script that connect to Oracle 10g and execute a package. That package execute severals transactions and must generate log about process status each interval of time. What i'm doing now is saving the plsql package log in an auxiliar... (4 Replies)
Discussion started by: jparra
4 Replies

5. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

6. Shell Programming and Scripting

reading ps command's output line by line

hi; as a pseudo; while read psLine do myFunc $psLine done < ps i don't want to redirect ps command's to a file. in fact, my problem is "how can i read stdout line by line in bash, sed, awk or any?" thanks, (5 Replies)
Discussion started by: s. murat
5 Replies

7. UNIX for Dummies Questions & Answers

Reading the output of df command

Can any body please explain the following df command to me:filesystem kbytes used avail capacity mounted on /dev/root 6474195 2649052 3825143 41% / /dev/stand 24097 5757 18340 24% /stand /proc 0 0 0 ... (7 Replies)
Discussion started by: nervous
7 Replies

8. Shell Programming and Scripting

reading command output from shell script

Hi List, How to read the output of a command executed from a script. For ex. sample_scritp.sh ------------- useradd testuser1 password testuser1 .... ..... -------------- This prompts for "password", and "confirm password", for which i need to give the values from script. Can... (4 Replies)
Discussion started by: sri b
4 Replies

9. Shell Programming and Scripting

Reading Input from File and Duplicates Output

Greetings to all, I would like to read input from a file and make duplications from it with Linux shell. For e.g. Input file ----------- ABC ABB ABA ------------------------------- Output file ------------ ABC ABC ABC ABB ABB (6 Replies)
Discussion started by: noelcantona
6 Replies

10. Programming

Reading console output

I am writing a program that uses system() to pass commands to the command interpreter. Is there a way to read the output that the commands produce? (1 Reply)
Discussion started by: Blaster999
1 Replies
Login or Register to Ask a Question