Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.


  Search this Thread
Old 09-19-2008, 04:42 AM   #1
LQ Newbie
Registered: Jul 2008
Posts: 5

Rep: Reputation: 0
how to set redirect for all commands

i know the redirect command can be wrote such as:$ ls > filelist.txt,are there any commands used to set the global redirect,so i don't need add each command >. thks
Old 09-19-2008, 12:27 PM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
You could launch a sub-shell with its standard In/Out/Err file descriptors redirected. Any processes launched by that sub-shell will inherit the redirected file descriptors.
File 'bashStdin.txt':
echo $SHLVL
echo $SHLVL
bash < bashStdin.txt
Fri Sep 19 10:23:03 PDT 2008
The same can be applied to standard out & standard error.
--- rod.

Last edited by theNbomr; 09-19-2008 at 12:28 PM.


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
how to set redirect command can be wrote such as:$ ls > filelist.txt,are there hillpigLQ Linux From Scratch 2 09-19-2008 09:55 PM
Set-up a network interface with commands?? helptonewbie Linux - Newbie 2 11-22-2007 04:45 AM
Etch Grub commands and set up Linux31 Debian 2 12-24-2006 05:36 AM
Set the path for shell commands??? acidblue Fedora 2 12-23-2005 11:23 PM
Setenv / set commands asaba Linux - Software 6 03-02-2005 04:35 AM

All times are GMT -5. The time now is 10:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration