Find the answer to your Linux question:
Results 1 to 6 of 6
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 ...
  1. #1
    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

  2. #2
    Linux Newbie
    Join Date
    Jan 2007
    Location
    Cupertino, CA
    Posts
    157
    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?

  3. #3
    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

  4. #4
    Linux Newbie
    Join Date
    Jan 2007
    Location
    Cupertino, CA
    Posts
    157
    What does the kitchen.sh script do?

  5. #5
    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

  6. #6
    Linux Newbie
    Join Date
    Jan 2007
    Location
    Cupertino, CA
    Posts
    157
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •