Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > Your Distro > Redhat / Fedora Linux Help > bash scripting..how to make it go line by line.

Forgot Password?
 Redhat / Fedora Linux Help   Help and discussion related to Redhat and Fedora Linux.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 03-05-2007   #1 (permalink)
Just Joined!
 
Join Date: May 2006
Posts: 39
bash scripting..how to make it go line by line.

hey all,

I am writing a bash script to get a file from a server, untar it and do some things with the content. once its done go back to the server and get the next file in the sequence and do the same to that file. thing is...when it is done the stuff to the contents it doesn wait till its done...it goes back to the top of the loop and starts again. and this messes with what is going on with the content of the previous file. I want it to wait till thats done then go back to get the next..i am using a while loop. any suggestions would be greatly appreciated.
OH i am using kettle to do the stuff to with the content of the tar file. Its an ETL process.

-B
ikiini is offline  


Reply With Quote
Old 03-05-2007   #2 (permalink)
Linux Newbie
 
Join Date: Jan 2007
Location: Cupertino, CA
Posts: 157
Send a message via Yahoo to nikunjb
Are you putting the process that processes the contents in the background? Or does it go to the background by itself? Can you post your script?
__________________
Registered Linux User #89115
nikunjb is offline   Reply With Quote
Old 03-05-2007   #3 (permalink)
Just Joined!
 
Join Date: May 2006
Posts: 39
Quote:
Originally Posted by nikunjb
Are you putting the process that processes the contents in the background? Or does it go to the background by itself? Can you post your script?
i don't know if it is...good question..

I don't know if kettle command line jobs run in the background...do they? cause thats where the problem occurs...

script snippet:

while [$startDate -le $endDate ] do
do someting
do something.

#now after the above is complete..run this job. the start over
./kitchen.sh -file=myfile.kjb -level=basic -norep=Y
startDate = $startDate+86400
done
ikiini is offline   Reply With Quote
Old 03-05-2007   #4 (permalink)
Linux Newbie
 
Join Date: Jan 2007
Location: Cupertino, CA
Posts: 157
Send a message via Yahoo to nikunjb
What does the kitchen.sh script do?
__________________
Registered Linux User #89115
nikunjb is offline   Reply With Quote
Old 03-06-2007   #5 (permalink)
Just Joined!
 
Join Date: May 2006
Posts: 39
the kitchen script did some ETL function..it loads some data from a couple text files into a database. I however solved my situation. I sourced the .bashrc and bash_profile after each line that takes a while. Not sure how that works...but it works...Thanks for the help.

-B
ikiini is offline   Reply With Quote
Old 03-06-2007   #6 (permalink)
Linux Newbie
 
Join Date: Jan 2007
Location: Cupertino, CA
Posts: 157
Send a message via Yahoo to nikunjb
That does not sound like a solution. How did you arrive at it? Can you post your kitchen.sh script as well as the .bashrc and bash_profile. Where did you source it in the main shell script... can you post the new one as well?
__________________
Registered Linux User #89115
nikunjb is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 06:13 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2