[clug] IO redirection

Kim Holburn kim.holburn at gmail.com
Sun Sep 17 13:15:21 UTC 2017


Why not just:

fish Test.txt

or 

. Test.txt

or

exec Test.txt 
But that is probably not what you want to do.

> On 2017/Sep/17, at 10:06 PM, Bryan Kilgallin (iiNet) via linux <linux at lists.samba.org> wrote:
> 
> OK Eyal:
> 
>> What command did you run to try to "execute input" and how did it fail?
> 
> In fish, the following is a valid command.
> {
> echo Testing.
> }
> 
> So I put that command into a "Test.txt" text file.
> 
> And in a terminal window, I entered the following.
> {
> exec <Test.txt
> }
> 
> Resulting in the following screen output.
> {
>       exec -- execute command in current process
> 
>   Synopsis
>       exec COMMAND [OPTIONS...]
> 
>   Description
>       exec replaces the currently running shell with a new command. On
>       successful completion, exec never returns. exec cannot be used inside
>       a pipeline.
> 
>   Example
>       exec emacs starts up the emacs text editor, and exits fish. When
>       emacs exits, the session will terminate.
> 
> 
> }
> 
> What is the appropriate way to take instructions from a file, and do them?
> 
>> For example, this command:
>>     sort <infile >outfile
>> should "read standard input", sort it, then "write standard output". does this work for you?
> 
> Yes, that worked fine!
> -- 
> www.netspeed.com.au/bryan/
> 
> -- 
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux

-- 
Kim Holburn
IT Network & Security Consultant
T: +61 2 61402408  M: +61 404072753
mailto:kim at holburn.net  aim://kimholburn
skype://kholburn - PGP Public Key on request 






More information about the linux mailing list