response of a for loop?!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers response of a for loop?!
# 1  
Old 06-25-2007
response of a for loop?!

Dear guys,
I don't know the response of a for loop in this situation:
suppose that file1 is an empty file.

and i make a for loop as :
for i in `cat file1`

What will be the response of the for loop:
1- will an error message apear
2- or the for loop simply will not run,and it will escape the for loop to the next step in the script?

i know that I can try it myself but the problem is that I can't log to my system for 5 days as i am on vacation.
thanks for your usual support.
# 2  
Old 06-25-2007
Marwan,
In this case, if you have an empty file, nothing inside of the
'for' command will be executed.
# 3  
Old 06-25-2007
thanks Shell_Life for your fast reply
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Response Times

Hello all. Let me qualify my question by saying that I am struggling with how to ask the question I am semi green but have no issue reading up if pointed in the right direction. Please be gentle! A RHEL server 6.2. Hosts a statistical application that has some web apps and batch programming... (0 Replies)
Discussion started by: rsheikh01
0 Replies

2. Solaris

Timeout: No Response from localhost

Hi All! I having an issue when trying to run snmpwalk, so the following command it returns an error: bash-3.00# /usr/sfw/bin/snmpwalk -v 2c -c public localhost sysDescr.0 Timeout: No Response from localhost bash-3.00# I have checked also: bash-3.00# svcs -a | grep sma online ... (2 Replies)
Discussion started by: fretagi
2 Replies

3. Post Here to Contact Site Administrators and Moderators

Slow response from website

Hi, I am experiencing slow response of unix.com from past 3-4 days. like- - most of the time the page does not reload instantly (when I do a manual reload from browser) - not able to view graphics. ( displays only text). - when posting into forum, the page gets stuck for considerably long... (6 Replies)
Discussion started by: clx
6 Replies

4. AIX

Ping response

:confused:Hi, In linux if ping to a system from a linux server it shows ping time=0.120ms how we can achive this in aix. i need this for a latency check. Thanks in advance. (5 Replies)
Discussion started by: vjm
5 Replies

5. IP Networking

Traceroute response

I have 20 servers I installed an application to that is returning message " wrong dispatcher or port " when starting agents. They all have the same dispatcher ip and going through the same port number. After verifying there are no application issues, we figured it was firewall related. The Firewall... (1 Reply)
Discussion started by: HFJ
1 Replies

6. UNIX for Dummies Questions & Answers

brainstorming automated response

I am managing a database of files for which there is a drop-box and multiple users. what i would like to do is set a criteria for files coming into the drop-box based on file structure. (they must be like this W*/image/W*-1234/0-999.tif) If the files do not match the criteria i want them to be... (1 Reply)
Discussion started by: Movomito
1 Replies

7. SCO

Slow cd response

Hi All We have one SCO Server here and it never gives us any trouble. Until Now!! Well its not earth shattering but we have one user who is complaining of a very slow response time when changing to his Home Directory. Other users who have similar profiles are OK. I have su'd to this user and I can... (0 Replies)
Discussion started by: JohnOB
0 Replies

8. Post Here to Contact Site Administrators and Moderators

Response to Homework Questions.

Just a suggestion, but it might help to pare down the number of threads that have little "added value" if the Moderators were to delete these posts rather than simply "close" them. Case in point, this thread was started by someone who asked for a homework solution. The poster received a reply... (2 Replies)
Discussion started by: google
2 Replies

9. Shell Programming and Scripting

Reading response from server

I am trying to write a korn shell script which posts commands to a server and read the response back from the server. Any idea how I can read the servers response? I have tried doing the following: ( LOGIN:xxxxx command to server read ANSWER echo $ANSWER >file1... (4 Replies)
Discussion started by: frustrated1
4 Replies
Login or Register to Ask a Question