The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
for loop not working - syntax error at line 6: `end of file' unexpected debojyoty Shell Programming and Scripting 3 04-13-2009 10:31 AM
If then else loop not working findprakash UNIX for Dummies Questions & Answers 2 05-25-2008 01:43 AM
if loop is not working ranga27 Shell Programming and Scripting 3 09-16-2007 01:19 PM
how to get the similar function in while loop or for loop trynew Shell Programming and Scripting 3 06-17-2002 12:09 PM
Loop not working nitin Shell Programming and Scripting 2 11-07-2001 07:55 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-13-2008
bullz26 bullz26 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 78
Thumbs down For loop not working...! :(

Could some one help me on this... For loop is working...!

for x in $i
do
for y in $j
do

z=`echo $y | awk '{print $2}'`

if [ "$x" = "$z" ]
then
FS=`/usr/bin/echo $y`
echo $FS >>$Basic_location/out.csv
fi

done
CPRT="Cpoyright @ BTOIDCIM"
done



I will say what i am trying to get the output...!
I am searching for a specific mountmoint...?

don't say that can use this simple option df -k <mountpoint>
If the requred mountpoint is notmounted! then i will get the o/p for root mount point...!

Please some one help me....?
  #2 (permalink)  
Old 03-14-2008
yhacks yhacks is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 21
Are there any variables and arguments ????

What are $i and $j,
Are there any arguments passed while running the script
  #3 (permalink)  
Old 03-14-2008
mvictorvijayan mvictorvijayan is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 29
For loop not working?

Working of for loop depends on the shell. I think you are trying to run the for loop $i and $j times. If you use the k shell the loop will run only once. You need to try while loop or some other logic.
  #4 (permalink)  
Old 03-16-2008
dusriniv dusriniv is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 2
For expects static values or constants. This may not work. Try while or until.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0