![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| inline redirect stdin | ct2marer | UNIX for Advanced & Expert Users | 2 | 09-09-2008 09:50 PM |
| inline redirect stdin | ct2marer | Shell Programming and Scripting | 5 | 09-09-2008 09:50 AM |
| Redirect stdin and out to sockets | gyula | High Level Programming | 1 | 09-02-2008 10:30 AM |
| redirect STDIN | prkfriryce | Shell Programming and Scripting | 4 | 01-04-2007 10:11 AM |
| stdin not tty when try to pine or redirect | Micz | UNIX for Dummies Questions & Answers | 1 | 05-20-2004 02:58 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Cannot redirect to STDIN in a shell script
I am unable to use STDIn redirection with < (commands)
When I do the following, both approaches work and give the same results: 1. Code:
$ printf "aaa\nbbb\n" > file1 $ printf "111\n222\n" > file2 $ cat file1 file2 aaa bbb 111 222 Code:
$ cat <(printf "aaa\nbbb\n") <(printf "111\n222\n") aaa bbb 111 222 I am using Cygwin1.5.25-15 Any clue? |
|
||||
|
Thanks, but apparently this goes beyond the Cygwin element.
I tried that on a Linux bash: 1. Works fine as a line: Code:
-bash-3.1$ cat <(printf "aaa\nbbb\n") <(printf "111\n222\n") aaa bbb 111 222 Code:
-rw-r--r-- 1 cleseb01 cleseb01 51 Feb 11 16:27 script
-bash-3.1$ cat script
cat <(printf "aaa\nbbb\n") <(printf "111\n222\n")
-bash-3.1$ sh script
script: line 1: syntax error near unexpected token `('
script: line 1: `cat <(printf "aaa\nbbb\n") <(printf "111\n222\n")'
|
|
||||
|
Code:
$ cat script #!/bin/bash cat <(printf "aaa\nbbb\n") <(printf "111\n222\n") Code:
$ sh script
script: line 2: syntax error near unexpected token `('
script: line 2: `cat <(printf "aaa\nbbb\n") <(printf "111\n222\n")'
|
| Sponsored Links | ||
|
|