LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-20-2003, 09:29 PM   #1
spyghost
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 245

Rep: Reputation: 30
output redirection to another directory


hi,

i just wanted to ask if it is possible to redirect an output to another directory w/o the use of variables (that is directly with just a single <ENTER>)

example:
assuming that i am working on a java class file and i want my filename to be the current date and time i would type,

$ java javafile >`date '+%D%M%Y_%H%M%S'`

right?

but what would happen is that the output file would be placed on the "current directory" (/home/username/javafiles). what if, i want the file to be redirected to the destination directory that i want? for example, i want to place it under /home/username/javafiles/testoutput

is it possible?

thanks in advance
 
Old 09-20-2003, 10:34 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Just put the path before the name of the file.....

$ java javafile > /home/username/javafiles/`date '+%D%M%Y_%H%M%S'`

Is that what your asking or something else?
 
Old 09-21-2003, 12:38 AM   #3
spyghost
Member
 
Registered: Jun 2003
Distribution: Redhat
Posts: 245

Original Poster
Rep: Reputation: 30
yup... thanks a lot!!!

now why didn't i think of that...
 
Old 09-21-2003, 09:28 AM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally posted by spyghost
yup... thanks a lot!!!

now why didn't i think of that...
I ask myself that all the time as well on the simple stuff...
 
  


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
what is output redirection? LinuxPadawan General 5 05-18-2005 12:53 PM
Output redirection rmartine Linux - Newbie 2 01-25-2005 06:31 PM
Output & input redirection serotonincy Programming 3 04-12-2004 08:28 AM
Minor output redirection problem.. Tyir Linux - General 0 01-27-2004 09:13 PM
Output redirection legtester Linux - General 4 07-07-2003 02:36 PM


All times are GMT -5. The time now is 11:29 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration