LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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

Reply
 
Search this Thread
Old 02-08-2011, 09:16 AM   #1
rami_hachem
LQ Newbie
 
Registered: Feb 2011
Posts: 5

Rep: Reputation: 0
how to use tee linux command


Deal all,
I am trying to install NS2.29 on ubuntu 8.04 and when I try to do the following command:
sudo ./install (it works) and if I try to redirect as follow
sudo ./install |tee output it give me the following message
"tee: output.txt: Permission denied"

can you help please
 
Old 02-08-2011, 09:23 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,503

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
The problem is that redirection is interpreted as called from the normal user. To avoid this kind of problems, run the commands in a subshell using quotes, e.g.
Code:
sudo bash -c './install | tee output'
 
Old 02-08-2011, 09:26 AM   #3
rami_hachem
LQ Newbie
 
Registered: Feb 2011
Posts: 5

Original Poster
Rep: Reputation: 0
ns2 on ubuntu

dear all,
can any one help me by sending the installion procedure for ns2.29 on ubuntu 8.04
 
Old 02-08-2011, 09:52 AM   #4
rami_hachem
LQ Newbie
 
Registered: Feb 2011
Posts: 5

Original Poster
Rep: Reputation: 0
register warning trace in the tee outuput file

hi colucix
thanks for your answer it works,
but in the terminal i see some warnning message but i dont see them in the output file using ( | tee output )
 
Old 02-08-2011, 09:59 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,978
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
That's because you didn't redirect stderr as well.

Code:
sudo bash -c './install 2>&1 | tee output'
 
  


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
tee command implementation hellorajni Linux - Software 2 11-10-2010 12:54 PM
how does tee command implemented? hellorajni Linux - Newbie 1 11-04-2010 02:51 PM
tee command source code? mdfakkeer Linux - Software 2 02-18-2010 04:28 AM
how to copy drive using dd and tee command parallely? source code of dd command mdfakkeer Linux - Software 1 02-10-2010 01:31 PM


All times are GMT -5. The time now is 12:11 AM.

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