LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-02-2010, 09:59 PM   #1
rastin_nz
LQ Newbie
 
Registered: Oct 2010
Posts: 17

Rep: Reputation: 0
Wink need to copy the obtained output files inside corresponding folders LINUX


Hi everyone!
I have encountered a problem:
I have "while" loop; at each run a set of outputs is produced but then I need to shift them into a corresponding folder ; otherwise next run the new outputs will be over-written. Furthermore, I need to pipe what I have on the screen inside a file.
I have put my code in the following:
Code:
# !/bin/bash
jf="GeoQuery.jar"
fmt="event geo:"
while read -r ID
do
echo $ID //read the event number from a text file to produce output//
java -jar $jf -$fmt$ID // java client give back the output based on the ID. now I need to create a folder using $ID and put the output there ????? [NEED HELP WITH IT]
done < <(paste cupid.txt)
your help is much appreciated.
Sepi
 
Old 11-03-2010, 11:19 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
a set of outputs is produced
What is the 'set of outputs'? File(s), text to standard output &/or standard error device, other, combinations of these?
Files of specific names can be moved or copied to other filenames in other directories. Standard IO can be captured to speified files. Other things probably require more work; you need to specify.

--- rod.
 
Old 11-03-2010, 04:41 PM   #3
rastin_nz
LQ Newbie
 
Registered: Oct 2010
Posts: 17

Original Poster
Rep: Reputation: 0
I rephrased my problem : I hope it helps :

I have a "while" loop ;
1. I need to create a folder at each run ( folder with different names)
Code:
mkdir $i // i can be a counter to have different name each time ?!!! not sure
2.I should then move all the files of type ".SEED" to the created folder. (copy > paste & delete from the current directory)
Code:
rm *.SEED  //need help I do not know how to transfer the files
 
Old 11-03-2010, 07:14 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Code:
mv ./*.SEED $i
--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Entering folders recursively to run script on files nested inside, ubuntu 7.10 aidansmoker Linux - Newbie 4 11-12-2007 12:39 AM
Command to copy files/folders but skip bad/corrupt files?? leemoreau Linux - Newbie 2 04-02-2007 03:27 PM
How to unzip files recursively inside folders? jessdog9001 Linux - Software 2 03-22-2006 01:59 PM
copy files and folders codepoet Linux - Newbie 2 06-12-2005 03:08 PM
how to copy files/folders??? Gallienus Linux - General 4 12-15-2003 01:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration