Hay varias maneras de manejar stdin:
#!/bin/bash
while read line
do
echo -e "Linea : $line";
done
leo@leo-desktop:~/Escritorio$ ls -1 | ./shell.sh
Linea : code.sh~
Linea : Cosas
Linea : fbcmd_update.php
Linea : instalado.txt
Linea : shell.sh
Linea : test
leo@leo-desktop:~/Escritorio$ echo -e "Hola mundo\!" | ./shell.sh
Linea : Hola mundo!
leo@leo-desktop:~/Escritorio$ echo -e "Hola mundo\!" | ./shell.sh
#!/bin/bash
cat -
exit 0
leo@leo-desktop:~/Escritorio$ ls -1 | ./shell.sh
code.sh~
Cosas
fbcmd_update.php
instalado.txt
shell.sh
test
leo@leo-desktop:~/Escritorio$