I have this:
delete_lock(){ first_arg=$1 } node x.js | delete_lock $0 < ${my_named_pipe} & I am looking to read from my_named_pipe into the stdin of the node.js process, and upon certain input, then write to stdout in the node.js process which would then be captured by delete_lock.
My main question is, how can I reference stdin in delete_lock in bash? I don't think it's $0, how can I do it?
Is this the only way to do it?
node x.js | { while read line; delete_lock $line; } < ${my_named_pipe} &