LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-18-2006, 01:47 PM   #1
ceetrom
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Rep: Reputation: 0
Shell command's output (re)direction


Hi all,

I would like something like this:

pacman -S mc > stdout > mc.log

So, I would like to interact with the pacman. And in the same time I want to (re)direct it's result to a file.

Is that possible?
 
Old 10-18-2006, 02:04 PM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043

Rep: Reputation: 83
Only if pacman allows interaction.
 
Old 10-18-2006, 07:16 PM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,246

Rep: Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025
Assuming you can do that with pacman, you'll prob want the tee cmd: http://www.tldp.org/LDP/abs/html/ioredirintro.html
 
Old 10-19-2006, 12:53 PM   #4
ceetrom
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Chris, that is great!
THX...
 
Old 10-19-2006, 01:21 PM   #5
soggycornflake
Member
 
Registered: May 2006
Location: England
Distribution: Slackware 10.2, Slamd64
Posts: 249

Rep: Reputation: 31
I don't know about bash, but zsh can do multiple redirection itself, e.g.

Code:
echo FOO > foo1 > foo2
will create both foo1 and foo2. Doesn't seem to work in bash, but it may have an option for it (zsh requires multios option set).
 
  


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
Interperting AT command's file names cmnorton Linux - General 1 04-28-2008 01:14 PM
Why several instances if command's only issued once? chadwick Linux - General 4 12-24-2005 08:25 PM
Shell output location pk_fox Linux - General 4 03-24-2005 07:44 AM
What does 'one file system' (copy command's -x arguement) mean? davidas Linux - Newbie 1 04-13-2004 02:07 AM
funny shell output... Joey.Dale General 3 03-26-2004 11:11 PM


All times are GMT -5. The time now is 02:32 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