NOTE: This question has arisen due to asynchronous processing of 'Process Substitution'. The script responses were deceptive, causing many lost hours. A previously related post is here: cat in process substitution hangs: what is it waiting for?
Bash 4.4.19(1)-release
Using this code because I cannot use pipes.
func() {
in=$(cat)
echo "'this is it: $in'"
}
echo "a string" > >(func)
This Process Substitution unfortunately is printing the prompt along with my string.
user@srv:~$ ./test.sh
user@srv:~$ 'this is it: a string'
This is undesirable for my usage! to say the least!!!
What is desirable is normal behavior like so:
user@srv:~$ ./test.sh
'this is it: a string'
Can I force Process Substitution not to print a shell prompt?
NOTE: I cannot use pipes... it creates other problems for me. These are the problems it creates: Can I process command output just before sending it to a file (one liner)?
PS1
though.