Browse Source

fragment for reading stdin in a shell function

master
Brennen Bearnes 2 years ago
parent
commit
8eef89f31d
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      home/fragments/func-stdin.sh

+ 9
- 0
home/fragments/func-stdin.sh View File

@ -0,0 +1,9 @@
#!/bin/sh
myread () {
while read foo; do
echo "$foo";
done
}
cat /etc/motd | myread

Loading…
Cancel
Save