Skip to content

Tag: bash

running bash piped comand from mono linux

I am trying to run bash command with pipe using mono process start here is code snippet I am trying single commands works, however pipe commands fails to run, what am I missing here ? I tried running “ps -aux” which runs fine. However ps -aux | grep gnome command failed. I tried these scenarios sc…

Nested grep with SSH

I have a following Shell command which runs successfully: However, I have to SSH to a particular machine to run this. To avoid this, I modified it in following way which leads to the failure: What is wrong with this command? How can I fix this? Answer Embed your code in a quoted heredoc to avoid needing to mo…

Can’t use multiplication in arithmetic expression

The above is the content of calculate.sh. If I use +, -, or /, I get the correct answer, but when I use *, it reports an error: How can I resolve this problem? Answer The problem was as pointed by others the fact than the character * is interpreted by your shell, be it in your terminal or your

Looping through the file,searching nan’s

I have file with 12000 lines,some of them are nan’s I have written bash,to search for these nan’s But only this appears on the screen What’s wrong with my bash? Answer you are using exit statement, that means this script will immediately exit after printing FIRST error: Not a number . So wha…