Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-01-2003, 12:50 PM
|
#1
|
Member
Registered: Jun 2002
Distribution: RH, FC, FreeBSD,OpenBSD
Posts: 326
Rep:
|
Putting error messages on the screen into a file...
Well, hopefully this will be a simple question here. It seems this morning im having a major brain fart and cant remember how to do a bunch of things.
Here is what I'm doing. Im working with samba 3.0 beta to do some preliminary testing. However, im running into a few snags when trying to mount certain things and use some of the new features...When this happens, it kicks out errors onto the screen and gives me some codes and things to check.
What i'd like to do is put these error messages into a file and keep them handy.
I've tried the tee command, for example:
samba command to mount share blah blah blah | tee > error.log
Hoping that this would kick out the errors to my log. But it's not.
So the next thing Im trying to do is somehow copy the messages off the screen and kick them to another file.
Even if I have to type the full message, how can I put it into a file without opening up a text editor...
What I mean is: Can I type the message and then somehow use cat to put it into a file?
cat error message, blah blah > error.log
ANy ideas?
Thanks.
Tarballed
|
|
|
07-01-2003, 12:53 PM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
you're just not redirecting the right stream...
command 2> log
will capture the stderr stream rather than stdout
|
|
|
07-01-2003, 01:14 PM
|
#3
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
Remember you can log both stderr and stdout using:
command 2>&1 > log
|
|
|
07-01-2003, 02:01 PM
|
#4
|
Member
Registered: Jun 2002
Distribution: RH, FC, FreeBSD,OpenBSD
Posts: 326
Original Poster
Rep:
|
Thanks guys.
Do you know if that can be run in conjunction with smbmount?
For example:
smbmount //server/share /mnt/samba -o username=admin 2>&1> log
Reason I ask is that I know, if I run a command very similiar to the one above (with -o username) I will be prompted for a password. Will that have any effect on the output of the error?
Thanks guys.
Tarballed
|
|
|
All times are GMT -5. The time now is 10:31 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|