Skip to main content
12 events
when toggle format what by license comment
Apr 20, 2018 at 20:33 comment added Kusalananda Ah, I see. I'll look at your new question.
Apr 20, 2018 at 20:32 comment added Alexander Mills dog could be anything, I don't know what dog is in advance. I think it needs to be while read line; ... then I inspect the line.
Apr 20, 2018 at 20:31 comment added Kusalananda @AlexanderMills Just grep -q 'dog'. grep will read from standard input by default if you don't give it a filename, and standard input (within the function) comes directly from the Node application.
Apr 20, 2018 at 20:31 comment added Alexander Mills Maybe this question makes it more clear: unix.stackexchange.com/questions/439021/…
Apr 20, 2018 at 20:26 comment added Alexander Mills yeah see I don't understand how to read the input - how I can reference the stdin - say "dog" is sent to stdin, how do I reference it? (in the delete_lock function).
Apr 20, 2018 at 9:10 comment added Kusalananda @AlexanderMills See updated answer.
Apr 20, 2018 at 9:10 history edited Kusalananda CC BY-SA 3.0
added 384 characters in body
Apr 20, 2018 at 9:01 vote accept Alexander Mills
Apr 20, 2018 at 9:01 comment added Alexander Mills yeah I don't follow - maybe can you add an example of delete_lock reading from the node command? I am not so good at bash that I know how, I can only guess that the read command would then go inside the delete_lock function.
Apr 20, 2018 at 8:58 comment added Kusalananda @AlexanderMills I don't really see a use for that. delete_lock can parse the output of the Node application in any way it wants. If it wants to act on certain input, then use grep -q (for example) on the input stream. Basically, I can't say much about this because you have not described what delete_lock needs to be doing.
Apr 20, 2018 at 8:52 comment added Alexander Mills thanks, do you have thoughts on alternative to using read to get a var representing stdin?
Apr 20, 2018 at 8:26 history answered Kusalananda CC BY-SA 3.0