ALL


  Concise bash programming skills

The following are some concise bash programming skills which we may need in our daily programming work.1. Check status of command execution The usual way:echo abcdee | grep -q abcd if [ $? -eq 0 ]; then echo "Found"else echo "Not found"fiConcise way:if echo abcdee | grep -q abc; then echo "Found"else echo "Not found"fiOf course you can remove if...else with following code[Sun Nov 04 05:58 AM] [kodango@devops] ~/workspace $ echo abcdee | grep -q abc && echo "Found" || echo "Not found"Found2. Redirect standard out and standard error to /dev/nullThe usual way:grep"abc" te...

10,275 2       TIP BASH SKILL