Re: dhcpcd runhooks- which shell?
Roy Marples
Tue Aug 30 10:00:39 2016
Hi Roger
On 30/08/2016 10:45, Roger Shepherd wrote:
> Thanks for the fast response and for the suggestions on how to use
> bash if I really need to. [I did (eventually) guess that the reason
> for using sh was compatibility].
>
> In fact, the problem I had was that sh doesn’t accept <<< as
> redirection whereas bash does. And as it’s decades (literally) since
> I’d done any shell scripting all debugging takes a long time. But
> it’s a learning experience.
So <<< appears to here-strings. example:
$ cat <<< "hello world"
hello world
This can easily be done with a pipe
$ echo "hello world" | cat
hello world
You're particular use case may not work with a pipe as the primary use
of <<< appears to be allow read $var1 $var2 to work. But even then you
can do this:
set -- hello world
echo $1
echo $2
hello
world
and get the same effect.
Roy
Archive administrator: postmaster@marples.name