Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
2k views

POSIX and Portability | shell scripts | grep -s, grep -q

I am all in for portability in regards to shell scripts. But I am unsure if I am overdoing it right now. In this example, we have a function called confirmation, which accepts the very first ...
Vlastimil Burián's user avatar
3 votes
4 answers
11k views

Test if command accepts a specific option

What is the preferred way to test if a command takes an option? What are the caveats? As a motivating example, at login my shell aliases grep to add several --exclude-dir options but this option is ...
Praxeolitic's user avatar
  • 1,688