Skip to content

Tag: bash

How to use grep in shell with -e option set

In bash -e option stops executing after an error and grep commands returns a non-zero status in case it does not find for the pattern it is looking for. I want to use grep inside an if statement, something like If i use $? to get the statement of last command, then the execution stops after last command as gr…

Find usage % of a directory in the disk [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …