Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Java Text Output

Name: Anonymous 2012-03-27 21:37

So I'm working on a program right now and I'm saving the output to a text file from the command line like so:
java Program >> output.txt

However, this does not save error messages.
Is there a way to have it include error messages?

Name: Anonymous 2012-03-27 21:45

Java
Stopped reading there.

Name: Anonymous 2012-03-27 22:05

java Program >output.txt &2>errors.txt

Name: OP 2012-03-28 1:24

Thanks guys.

Name: Anonymous 2012-03-28 11:37

>>4
Linux 101 man, take it.

Name: Anonymous 2012-03-28 12:17

>>3
That won't work on something like Windows XP.

Name: Anonymous 2012-03-28 12:22

>>5
It wasn't a Linux question. And the fact that you think it was just tells me that you have reading comprehension problems.

Name: Anonymous 2012-03-28 12:32

>>7
If you want to be pedantic, it's a question about whatever shell you're using. And I believe that that behavior is specified in POSIX, which would make it a *nix question. So yes, it is something that you should learn in a Linux class.

Name: Anonymous 2012-03-28 12:49

>>8
I don't see any mention of the word shell in >>1.

Name: Anonymous 2012-03-28 12:50

>>8
Also you dumbass, a .txt extension tends to be a Windows thing, and not a Linux thing.

Name: Anonymous 2012-03-28 12:51

This is because a "text file" in Windows is a different than a "text file" in Linux.

Name: Anonymous 2012-03-28 13:11

>>10
you can use whatever extension you want in GNU/Linux... .txt or otherwise, it makes no difference, really

you could do echo hurr > herp.derp and it's still a text file

I name my backup versions of config files *.*.BACK, and although it's not an official extension it doesn't matter at all
>>11
if I remember correctly, the only real difference is how they handle EOLs

but when saving a text file in a program such as, say, gedit (and yes, I know that's not a ``true'' text editor, fuck off) you can specify what kind of line ending to use

Name: Anonymous 2012-03-28 13:32

>>12
There's a tad bit more than just EOL. With that, I still don't see anything in the
OP's post that would imply they are on a Linix box.

Name: Anonymous 2012-03-28 13:55

LOONIX IS EVIL

Name: Anonymous 2012-03-28 14:22

>>13

3  Name: Anonymous : 2012-03-27 22:05
java Program >output.txt &2>errors.txt
4  Name: OP : 2012-03-28 01:24
Thanks guys.

This

Don't change these.
Name: Email:
Entire Thread Thread List