Using xargs
did something I didn't quite expect, though I guess it sort of makes sense. This is not what I did, but this is an example which should show what happened.
fn.sh
#!/usr/bin/bash
index=1
for arg in "$@"; do echo "Arg #$index = '$arg'"; let ++index; done
read -p "type something followed by enter: " a
echo "You typed '$a'."
Now here is the command:
echo boo hoo | xargs ./fn.sh
Now what I want is that fn.sh
can read from stdin
to allow user interaction, but that's been usurped by xargs
. I guess I could get xargs
to read from a temporary file, but I was wondering if it can use an unnamed file.