Question: I'm new to embedded and am reading 'Embedded Linux Primer' at the moment.

I tried to build an xscale arm kernel: 

```
make ARCH=arm CROSS_COMPILE=xscale_be- ixp4xx_defconfig
#
# configuration written to .config

```

followed by the make:

```
~/linux-stable$ make ARCH=arm CROSS_COMPILE=xscale_be- zImage
make: xscale_be-gcc: Command not found
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
/bin/sh: 1: xscale_be-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2

```

I had downloaded and extracted gcc-arm-none-eabi-4\_9-2014q4 from
<https://launchpad.net/gcc-arm-embedded>

and set the path

PATH=/opt/gcc-arm-none-eabi-4\_9-2014q4/bin/

Do I need another compiler for the xscale architecture?

Any ideas where I can find xscale\_be-gcc?

Answer: 
You could use named pipes (<http://linux.die.net/man/1/mkfifo>) on the command line of `tee` and have the commands reading on the named pipes.

```
mkfifo /tmp/data0 /tmp/data1 /tmp/data2
cmd0 < /tmp/data0 & cmd1 < /tmp/data1 & cmd2 < /tmp/data2 &
command -option1 -option2 argument | tee /tmp/data0 /tmp/data1 /tmp/data2

```

When `command` finishes, `tee` will close the named pipes, which will signal an EOF (read of 0 bytes) on each of the `/tmp/dataN` which would normally terminate the `cmdN` processes. Real example:

```
$ mkfifo /tmp/data0 /tmp/data1 /tmp/data2
$ wc -l < /tmp/data0 & wc -w < /tmp/data1 & wc -c < /tmp/data2 &
$ tee /tmp/data0 /tmp/data1 /tmp/data2 < /etc/passwd >/dev/null
$ 61
1974
37

```

Because of the background processes, the shell returned a prompt before the program output. All three instances of `wc` terminated normally.
If I understand correctly, you're looking for the equivalent of `tee file1 file2 file3`, but rather than write the same data to three files `file1`, `file2` and `file3`, you want to pipe the same data into three commands `cmd1`, `cmd2` and `cmd3`, i.e.

```
… | ??? cmd1 cmd2 cmd3

```

should be equivalent to

```
… | cmd1 &
… | cmd2 &
… | cmd3 &

```

except that `…` would only be executed once.

There are two ways to do that.

Ksh93, bash and zsh support [process substitution](http://www.gnu.org/software/bash/manual/bash.html#Process-Substitution). This is a generalization of pipes that allows the argument of a command to be a file that, when written to, passes data as input to a command (there is also the input variant which, when read from, obtains data output by a command). That is,

```
echo hello | tee >(cmd1)

```

prints `hello` to standard output and in addition runs `cmd1` with `hello` as input.

So for example, if you want to duplicate the input of `somecommand` and pass it to both `cmd1` and `cmd2`, you can use

```
somecommand | tee >(cmd1) | cmd2

```

If your shell doesn't support process substitution, you can use named pipes instead. See [Arcege's answer](https://unix.stackexchange.com/a/188933) for how that works. Named pipes are less convenient than process substitution because you have to create them and delete them, and start and synchronize processes manually. They have the advantage of being fully portable, whereas not all shells support process substitutions. They can also be used in scenarios other than the ones process substitution is for.

Under the hood, on some systems, process substitution uses named pipes internally. On most systems, though, it relies on [named files representing file descriptors](https://unix.stackexchange.com/questions/156084/why-does-process-substitution-result-in-a-file-called-dev-fd-63-which-is-a-pipe).