Skip to main content
&lt;< &gt;> ( ) ; & | &lt;space&gt;<space> &lt;tab&gt;<tab> 
&lt; &gt; ( ) ; & | &lt;space&gt; &lt;tab&gt; 
< > ( ) ; & | <space> <tab> 
Prefer markdown to HTML (particularly for code blocks, where it enables prettify highlighting))
Source Link
Toby Speight
  • 7k
  • 1
  • 31
  • 43
  1. Abuse the ternary operator, ((test)) &&&& cmd1 || cmd2 or [ test ] &&&& cmd1 || cmd2, as much as possible.

    Examples (length counts always exclude the top line):

     t="$something" if [ $t == "hi" ];then cmd1 cmd2 elif [ $t == "bye" ];then cmd3 cmd4 else cmd5 if [ $t == "sup" ];then cmd6 fi fi 

    By using ternary operators only, this can easily be shortened to:

     t="$something" [ $t == "hi" ]&&{ cmd1;cmd2 }||[ $t == "bye" ]&&{ cmd3;cmd4 }||{ cmd5 [ $t == "sup" ]&&cmd6 } 

Examples (length counts always exclude the top line):

 t="$something" if [ $t == "hi" ];then cmd1 cmd2 elif [ $t == "bye" ];then cmd3 cmd4 else cmd5 if [ $t == "sup" ];then cmd6 fi fi 

By using ternary operators only, this can easily be shortened to:

 t="$something" [ $t == "hi" ]&&{ cmd1;cmd2 }||[ $t == "bye" ]&&{ cmd3;cmd4 }||{ cmd5 [ $t == "sup" ]&&cmd6 } 

As nyuszika7h pointed out in the comments, this specific example could be shortened even further using case:

 t="$something" case $t in "hi")cmd1;cmd2;;"bye")cmd3;cmd4;;*)cmd5;[ $t == "sup" ]&&cmd6;esac 
  1. As nyuszika7h pointed outAlso, prefer parentheses to braces as much as possible. Since parentheses are a metacharacter, and not a word, they never require spaces in any context. This also means run as many commands in a subshell as possible, because curly braces (i.e. { and }) are reserved words, not meta-characters, and thus have to have whitespace on both sides to parse correctly, but meta-characters don't. I assume that you know by now that subshells don't affect the commentsparent environment, this specificso assuming that all the example couldcommands can safely be shortened even further usingrun in a subshell case(which isn't typical in any case), you can shorten the above code to this:

     t="$something" case $t in "hi")cmd1;cmd2;;"bye")cmd3;cmd4;;*)cmd5;[ $t == "sup" ]&&cmd6;esac 
     t=$something [ $t == "hi" ]&&(cmd1;cmd2)||[ $t == "bye" ]&&(cmd3;cmd4)||(cmd5;[ $t == "sup" ]&&cmd6) 

     

Also, if you can't, using parentheses can still minify it some. One thing to keep in mind is that it only works for integers, which renders it useless for the purposes of this example (but it is much better than using -eq for integers).

  1. One more thing, avoid quotes where possible. Using that above advice, you can further minify it. Example:

     t=$something [ $t == hi ]&&(cmd1;cmd2)||[ $t == bye ]&&(cmd3;cmd4)||(cmd5;[ $t == sup ]&&cmd6) 
  2. Also, prefer parentheses to braces

    In testing conditions, prefer single brackets to double brackets as much as possible with a few exceptions. It drops two characters for free, but it isn't as robust in some cases (it's a Bash extension - see below for an example). Also, use the single equals argument rather than the double. It is a free character to drop.

     [[ $f == b ]]&&: # ... <-- Bad [ $f == b ]&&: # ... <-- Better [ $f = b ]&&: # ... <-- Best. word splits and pathname-expands the contents of $f. Esp. bad if it starts with - 

Note this caveat, especially in checking for null output or an undefined variable:

 [[ $f ]]&&: # double quotes aren't needed inside [[, which can save chars [ "$f" = '' ]&&: <-- This is significantly longer [ -n "$f" ]&&: 

In all technicality, this specific example would be best with case ... in:

 t=$something case $t in hi)cmd1;cmd2;;bye)cmd3;cmd4;;*)cmd5;[ $t == sup ]&&cmd6;esac 

So, the moral of this post is this:

  1. Abuse the boolean operators as much as possible. Since parentheses are a metacharacter, and not a word, they never require spaces in any contextalways use them instead of if/if-else/etc. This also meansconstructs.
  2. Use parentheses as much as possible and run as many commands in a subshellsegments as possible, in subshells because curly braces (i.e. { and })parentheses are reserved words, not meta-characters, and thus have to have whitespace on both sides to parse correctly, but meta-characters don't. I assume that you know by now that subshells don't affect the parent environment, so assuming that all the example commands can safely be run in a subshell (which isn't typical in any case), you can shorten the above code to this:

     t=$something [ $t == "hi" ]&&(cmd1;cmd2)||[ $t == "bye" ]&&(cmd3;cmd4)||(cmd5;[ $t == "sup" ]&&cmd6) 

    Also, if you can't, using parentheses can still minify it some. One thing to keep in mind is that it only works for integers, which renders it useless for the purposes of this example (but it is much better than using `-eq` for integers)not reserved words.
     
  3. One more thing, avoid Avoid quotes whereas much as physically possible. Using that above advice, you can further minify it. Example:

     t=$something [ $t == hi ]&&(cmd1;cmd2)||[ $t == bye ]&&(cmd3;cmd4)||(cmd5;[ $t == sup ]&&cmd6) 

     
  4. In testing conditions, prefer single brackets to double brackets as much as possible with a few exceptions Check out case . It drops two characters for free.. in, butsince it isn't as robust in some cases (it'smay save quite a Bash extension &endash; see below for an example). Alsofew bytes, use the single equals argument rather than the double. It is a free character to dropparticularly in string matching.
     [[ $f == b ]]&&: # ... <-- Bad [ $f == b ]&&: # ... <-- Better [ $f = b ]&&: # ... <-- Best. word splits and pathname-expands the contents of $f. Esp. bad if it starts with - 

    Note this caveat, especially in checking for null output or an undefined variable:

    [[ $f ]]&&: # double quotes aren't needed inside [[, which can save chars [ "$f" = '' ]&&: <-- This is significantly longer [ -n "$f" ]&&:

    In all technicality, this specific example would be best with case ... in:

     t=$something case $t in hi)cmd1;cmd2;;bye)cmd3;cmd4;;*)cmd5;[ $t == sup ]&&cmd6;esac 
So, the moral of this post is this:
  1. Abuse the boolean operators as much as possible, and always use them instead of if/if-else/etc. constructs.
  2. Use parentheses as much as possible and run as many segments as possible in subshells because parentheses are meta-characters and not reserved words.
  3. Avoid quotes as much as physically possible.
  4. Check out `case .. in`, since it may save quite a few bytes, particularly in string matching.

P.S.: Here's a list of meta-characters recognized in Bash regardless of context (and can separate words):

< > ( ) ; & | <space> <tab>  
 

P.S.: Here's a list of meta-characters recognized in Bash regardless of context (and can separate words):

EDIT: As manatwork pointed out, the double parenthesis test only works for integers. Also, indirectly, I found that you need to have whitespace surrounding the `==` operator. Corrected my post above.
&lt; &gt; ( ) ; & | &lt;space&gt; &lt;tab&gt; 

  
I also was too lazy to recalculate the length of each segment, so I simply removed them. It should be easy enough to find a string length calculator online if necessary.

EDIT: As manatwork pointed out, the double parenthesis test only works for integers. Also, indirectly, I found that you need to have whitespace surrounding the == operator. Corrected my post above.

I also was too lazy to recalculate the length of each segment, so I simply removed them. It should be easy enough to find a string length calculator online if necessary.

  1. Abuse the ternary operator, ((test)) && cmd1 || cmd2 or [ test ] && cmd1 || cmd2, as much as possible.

    Examples (length counts always exclude the top line):

     t="$something" if [ $t == "hi" ];then cmd1 cmd2 elif [ $t == "bye" ];then cmd3 cmd4 else cmd5 if [ $t == "sup" ];then cmd6 fi fi 

    By using ternary operators only, this can easily be shortened to:

     t="$something" [ $t == "hi" ]&&{ cmd1;cmd2 }||[ $t == "bye" ]&&{ cmd3;cmd4 }||{ cmd5 [ $t == "sup" ]&&cmd6 } 

    As nyuszika7h pointed out in the comments, this specific example could be shortened even further using case:

     t="$something" case $t in "hi")cmd1;cmd2;;"bye")cmd3;cmd4;;*)cmd5;[ $t == "sup" ]&&cmd6;esac 

     
  2. Also, prefer parentheses to braces as much as possible. Since parentheses are a metacharacter, and not a word, they never require spaces in any context. This also means run as many commands in a subshell as possible, because curly braces (i.e. { and }) are reserved words, not meta-characters, and thus have to have whitespace on both sides to parse correctly, but meta-characters don't. I assume that you know by now that subshells don't affect the parent environment, so assuming that all the example commands can safely be run in a subshell (which isn't typical in any case), you can shorten the above code to this:

     t=$something [ $t == "hi" ]&&(cmd1;cmd2)||[ $t == "bye" ]&&(cmd3;cmd4)||(cmd5;[ $t == "sup" ]&&cmd6) 

    Also, if you can't, using parentheses can still minify it some. One thing to keep in mind is that it only works for integers, which renders it useless for the purposes of this example (but it is much better than using `-eq` for integers).
     
  3. One more thing, avoid quotes where possible. Using that above advice, you can further minify it. Example:

     t=$something [ $t == hi ]&&(cmd1;cmd2)||[ $t == bye ]&&(cmd3;cmd4)||(cmd5;[ $t == sup ]&&cmd6) 

     
  4. In testing conditions, prefer single brackets to double brackets as much as possible with a few exceptions. It drops two characters for free, but it isn't as robust in some cases (it's a Bash extension &endash; see below for an example). Also, use the single equals argument rather than the double. It is a free character to drop.
     [[ $f == b ]]&&: # ... <-- Bad [ $f == b ]&&: # ... <-- Better [ $f = b ]&&: # ... <-- Best. word splits and pathname-expands the contents of $f. Esp. bad if it starts with - 

    Note this caveat, especially in checking for null output or an undefined variable:

    [[ $f ]]&&: # double quotes aren't needed inside [[, which can save chars [ "$f" = '' ]&&: <-- This is significantly longer [ -n "$f" ]&&:

    In all technicality, this specific example would be best with case ... in:

     t=$something case $t in hi)cmd1;cmd2;;bye)cmd3;cmd4;;*)cmd5;[ $t == sup ]&&cmd6;esac 
So, the moral of this post is this:
  1. Abuse the boolean operators as much as possible, and always use them instead of if/if-else/etc. constructs.
  2. Use parentheses as much as possible and run as many segments as possible in subshells because parentheses are meta-characters and not reserved words.
  3. Avoid quotes as much as physically possible.
  4. Check out `case .. in`, since it may save quite a few bytes, particularly in string matching.

P.S.: Here's a list of meta-characters recognized in Bash regardless of context (and can separate words):

< > ( ) ; & | <space> <tab>
 EDIT: As manatwork pointed out, the double parenthesis test only works for integers. Also, indirectly, I found that you need to have whitespace surrounding the `==` operator. Corrected my post above.

 I also was too lazy to recalculate the length of each segment, so I simply removed them. It should be easy enough to find a string length calculator online if necessary.
  1. Abuse the ternary operator, ((test)) && cmd1 || cmd2 or [ test ] && cmd1 || cmd2, as much as possible.

Examples (length counts always exclude the top line):

 t="$something" if [ $t == "hi" ];then cmd1 cmd2 elif [ $t == "bye" ];then cmd3 cmd4 else cmd5 if [ $t == "sup" ];then cmd6 fi fi 

By using ternary operators only, this can easily be shortened to:

 t="$something" [ $t == "hi" ]&&{ cmd1;cmd2 }||[ $t == "bye" ]&&{ cmd3;cmd4 }||{ cmd5 [ $t == "sup" ]&&cmd6 } 

As nyuszika7h pointed out in the comments, this specific example could be shortened even further using case:

 t="$something" case $t in "hi")cmd1;cmd2;;"bye")cmd3;cmd4;;*)cmd5;[ $t == "sup" ]&&cmd6;esac 
  1. Also, prefer parentheses to braces as much as possible. Since parentheses are a metacharacter, and not a word, they never require spaces in any context. This also means run as many commands in a subshell as possible, because curly braces (i.e. { and }) are reserved words, not meta-characters, and thus have to have whitespace on both sides to parse correctly, but meta-characters don't. I assume that you know by now that subshells don't affect the parent environment, so assuming that all the example commands can safely be run in a subshell (which isn't typical in any case), you can shorten the above code to this:

     t=$something [ $t == "hi" ]&&(cmd1;cmd2)||[ $t == "bye" ]&&(cmd3;cmd4)||(cmd5;[ $t == "sup" ]&&cmd6) 

Also, if you can't, using parentheses can still minify it some. One thing to keep in mind is that it only works for integers, which renders it useless for the purposes of this example (but it is much better than using -eq for integers).

  1. One more thing, avoid quotes where possible. Using that above advice, you can further minify it. Example:

     t=$something [ $t == hi ]&&(cmd1;cmd2)||[ $t == bye ]&&(cmd3;cmd4)||(cmd5;[ $t == sup ]&&cmd6) 
  2. In testing conditions, prefer single brackets to double brackets as much as possible with a few exceptions. It drops two characters for free, but it isn't as robust in some cases (it's a Bash extension - see below for an example). Also, use the single equals argument rather than the double. It is a free character to drop.

     [[ $f == b ]]&&: # ... <-- Bad [ $f == b ]&&: # ... <-- Better [ $f = b ]&&: # ... <-- Best. word splits and pathname-expands the contents of $f. Esp. bad if it starts with - 

Note this caveat, especially in checking for null output or an undefined variable:

 [[ $f ]]&&: # double quotes aren't needed inside [[, which can save chars [ "$f" = '' ]&&: <-- This is significantly longer [ -n "$f" ]&&: 

In all technicality, this specific example would be best with case ... in:

 t=$something case $t in hi)cmd1;cmd2;;bye)cmd3;cmd4;;*)cmd5;[ $t == sup ]&&cmd6;esac 

So, the moral of this post is this:

  1. Abuse the boolean operators as much as possible, and always use them instead of if/if-else/etc. constructs.
  2. Use parentheses as much as possible and run as many segments as possible in subshells because parentheses are meta-characters and not reserved words.
  3. Avoid quotes as much as physically possible.
  4. Check out case ... in, since it may save quite a few bytes, particularly in string matching. 

P.S.: Here's a list of meta-characters recognized in Bash regardless of context (and can separate words):

&lt; &gt; ( ) ; & | &lt;space&gt; &lt;tab&gt; 
 

EDIT: As manatwork pointed out, the double parenthesis test only works for integers. Also, indirectly, I found that you need to have whitespace surrounding the == operator. Corrected my post above.

I also was too lazy to recalculate the length of each segment, so I simply removed them. It should be easy enough to find a string length calculator online if necessary.

  1. Abuse the ternary operator, ((test)) && cmd1 || cmd2 or [ test ] && cmd1 || cmd2, as much as possible.

    Examples (length counts always exclude the top line):

     t="$something" if [ $t == "hi" ];then cmd1 cmd2 elif [ $t == "bye" ];then cmd3 cmd4 else cmd5 if [ $t == "sup" ];then cmd6 fi fi 

    By using ternary operators only, this can easily be shortened to:

     t="$something" [ $t == "hi" ]&&{ cmd1;cmd2 }||[ $t == "bye" ]&&{ cmd3;cmd4 }||{ cmd5 [ $t == "sup" ]&&cmd6 } 

    As nyuszika7h pointed out in the comments, this specific example could be shortened even further using case:

     t="$something" case $t in "hi")cmd1;cmd2;;"bye")cmd3;cmd4;;*)cmd5;[ $t == "sup" ]&&cmd6;esac 

     
  2. Also, prefer parentheses to braces as much as possible. Since parentheses are a metacharacter, and not a word, they never require spaces in any context. This also means run as many commands in a subshell as possible, because curly braces (i.e. { and }) are reserved words, not meta-characters, and thus have to have whitespace on both sides to parse correctly, but meta-characters don't. I assume that you know by now that subshells don't affect the parent environment, so assuming that all the example commands can safely be run in a subshell (which isn't typical in any case), you can shorten the above code to this:

     t=$something [ $t == "hi" ]&&(cmd1;cmd2)||[ $t == "bye" ]&&(cmd3;cmd4)||(cmd5;[ $t == "sup" ]&&cmd6) 

    Also, if you can't, using parentheses can still minify it some. One thing to keep in mind is that it only works for integers, which renders it useless for the purposes of this example (but it is much better than using `-eq` for integers).
     
  3. One more thing, avoid quotes where possible. Using that above advice, you can further minify it. Example:

     t=$something [ $t == hi ]&&(cmd1;cmd2)||[ $t == bye ]&&(cmd3;cmd4)||(cmd5;[ $t == sup ]&&cmd6) 

     
  4. In testing conditions, prefer single brackets to double brackets as much as possible with a few exceptions. It drops two characters for free, but it isn't as robust in some cases (it's a Bash extension &endash; see below for an example). Also, use the single equals argument rather than the double. It is a free character to drop.
     [[ $f == b ]]&&: # ... <-- Bad [ $f == b ]&&: # ... <-- Better [ $f = b ]&&: # ... <-- Best. word splits and pathname-expands the contents of $f. Esp. bad if it starts with - 

    Note this caveat, especially in checking for null output or an undefined variable:

    [[ "$f"$f ]]&&: # double quotes aren't needed inside [[, which can save chars [ "$f" = '' ]&&: <-- This is significantly longer [ -n "$f" ]&&:

    In all technicality, this specific example would be best with case ... in:

     t=$something case $t in hi)cmd1;cmd2;;bye)cmd3;cmd4;;*)cmd5;[ $t == sup ]&&cmd6;esac 
So, the moral of this post is this:
  1. Abuse the ternaryboolean operatoroperators as much as possible, and always use itthem instead of if/if-else/etc. constructs always.
  2. Use parentheses as much as possible and run as many segments as possible in subshells because parentheses are meta-characters and not reserved words.
  3. Avoid quotes as much as physically possible.
  4. Check out `case .. in`, since it may save quite a few bytes, particularly in string matching.

P.S.: Here's a list of meta-characters recognized in Bash regardless of context (and can separate words):

< > ( ) ; & | <space> <tab>
  1. Abuse the ternary operator, ((test)) && cmd1 || cmd2 or [ test ] && cmd1 || cmd2, as much as possible.

    Examples (length counts always exclude the top line):

     t="$something" if [ $t == "hi" ];then cmd1 cmd2 elif [ $t == "bye" ];then cmd3 cmd4 else cmd5 if [ $t == "sup" ];then cmd6 fi fi 

    By using ternary operators only, this can easily be shortened to:

     t="$something" [ $t == "hi" ]&&{ cmd1;cmd2 }||[ $t == "bye" ]&&{ cmd3;cmd4 }||{ cmd5 [ $t == "sup" ]&&cmd6 } 

    As nyuszika7h pointed out in the comments, this specific example could be shortened even further using case:

     t="$something" case $t in "hi")cmd1;cmd2;;"bye")cmd3;cmd4;;*)cmd5;[ $t == "sup" ]&&cmd6;esac 

     
  2. Also, prefer parentheses to braces as much as possible. Since parentheses are a metacharacter, and not a word, they never require spaces in any context. This also means run as many commands in a subshell as possible, because curly braces (i.e. { and }) are reserved words, not meta-characters, and thus have to have whitespace on both sides to parse correctly, but meta-characters don't. I assume that you know by now that subshells don't affect the parent environment, so assuming that all the example commands can safely be run in a subshell (which isn't typical in any case), you can shorten the above code to this:

     t=$something [ $t == "hi" ]&&(cmd1;cmd2)||[ $t == "bye" ]&&(cmd3;cmd4)||(cmd5;[ $t == "sup" ]&&cmd6) 

    Also, if you can't, using parentheses can still minify it some. One thing to keep in mind is that it only works for integers, which renders it useless for the purposes of this example (but it is much better than using `-eq` for integers).
     
  3. One more thing, avoid quotes where possible. Using that above advice, you can further minify it. Example:

     t=$something [ $t == hi ]&&(cmd1;cmd2)||[ $t == bye ]&&(cmd3;cmd4)||(cmd5;[ $t == sup ]&&cmd6) 

     
  4. In testing conditions, prefer single brackets to double brackets as much as possible with a few exceptions. It drops two characters for free, but it isn't as robust in some cases (it's a Bash extension &endash; see below for an example). Also, use the single equals argument rather than the double. It is a free character to drop.
     [[ $f == b ]]&&: # ... <-- Bad [ $f == b ]&&: # ... <-- Better [ $f = b ]&&: # ... <-- Best 

    Note this caveat, especially in checking for null output or an undefined variable:

    [[ "$f" ]]&&: [ "$f" = '' ]&&: <-- This is significantly longer

    In all technicality, this specific example would be best with case ... in:

     t=$something case $t in hi)cmd1;cmd2;;bye)cmd3;cmd4;;*)cmd5;[ $t == sup ]&&cmd6;esac 
So, the moral of this post is this:
  1. Abuse the ternary operator as much as possible, and always use it instead of if/if-else/etc. constructs always.
  2. Use parentheses as much as possible and run as many segments as possible in subshells because parentheses are meta-characters and not reserved words.
  3. Avoid quotes as much as physically possible.
  4. Check out `case .. in`, since it may save quite a few bytes, particularly in string matching.

P.S.: Here's a list of meta-characters recognized in Bash regardless of context (and can separate words):

< > ( ) ; & | <space> <tab>
  1. Abuse the ternary operator, ((test)) && cmd1 || cmd2 or [ test ] && cmd1 || cmd2, as much as possible.

    Examples (length counts always exclude the top line):

     t="$something" if [ $t == "hi" ];then cmd1 cmd2 elif [ $t == "bye" ];then cmd3 cmd4 else cmd5 if [ $t == "sup" ];then cmd6 fi fi 

    By using ternary operators only, this can easily be shortened to:

     t="$something" [ $t == "hi" ]&&{ cmd1;cmd2 }||[ $t == "bye" ]&&{ cmd3;cmd4 }||{ cmd5 [ $t == "sup" ]&&cmd6 } 

    As nyuszika7h pointed out in the comments, this specific example could be shortened even further using case:

     t="$something" case $t in "hi")cmd1;cmd2;;"bye")cmd3;cmd4;;*)cmd5;[ $t == "sup" ]&&cmd6;esac 

     
  2. Also, prefer parentheses to braces as much as possible. Since parentheses are a metacharacter, and not a word, they never require spaces in any context. This also means run as many commands in a subshell as possible, because curly braces (i.e. { and }) are reserved words, not meta-characters, and thus have to have whitespace on both sides to parse correctly, but meta-characters don't. I assume that you know by now that subshells don't affect the parent environment, so assuming that all the example commands can safely be run in a subshell (which isn't typical in any case), you can shorten the above code to this:

     t=$something [ $t == "hi" ]&&(cmd1;cmd2)||[ $t == "bye" ]&&(cmd3;cmd4)||(cmd5;[ $t == "sup" ]&&cmd6) 

    Also, if you can't, using parentheses can still minify it some. One thing to keep in mind is that it only works for integers, which renders it useless for the purposes of this example (but it is much better than using `-eq` for integers).
     
  3. One more thing, avoid quotes where possible. Using that above advice, you can further minify it. Example:

     t=$something [ $t == hi ]&&(cmd1;cmd2)||[ $t == bye ]&&(cmd3;cmd4)||(cmd5;[ $t == sup ]&&cmd6) 

     
  4. In testing conditions, prefer single brackets to double brackets as much as possible with a few exceptions. It drops two characters for free, but it isn't as robust in some cases (it's a Bash extension &endash; see below for an example). Also, use the single equals argument rather than the double. It is a free character to drop.
     [[ $f == b ]]&&: # ... <-- Bad [ $f == b ]&&: # ... <-- Better [ $f = b ]&&: # ... <-- Best. word splits and pathname-expands the contents of $f. Esp. bad if it starts with - 

    Note this caveat, especially in checking for null output or an undefined variable:

    [[ $f ]]&&: # double quotes aren't needed inside [[, which can save chars [ "$f" = '' ]&&: <-- This is significantly longer [ -n "$f" ]&&:

    In all technicality, this specific example would be best with case ... in:

     t=$something case $t in hi)cmd1;cmd2;;bye)cmd3;cmd4;;*)cmd5;[ $t == sup ]&&cmd6;esac 
So, the moral of this post is this:
  1. Abuse the boolean operators as much as possible, and always use them instead of if/if-else/etc. constructs.
  2. Use parentheses as much as possible and run as many segments as possible in subshells because parentheses are meta-characters and not reserved words.
  3. Avoid quotes as much as physically possible.
  4. Check out `case .. in`, since it may save quite a few bytes, particularly in string matching.

P.S.: Here's a list of meta-characters recognized in Bash regardless of context (and can separate words):

< > ( ) ; & | <space> <tab>
added 135 characters in body
Source Link
Claudia
  • 1.7k
  • 1
  • 18
  • 31
Loading
Mod Removes Wiki by Doorknob
added 197 characters in body
Source Link
Claudia
  • 1.7k
  • 1
  • 18
  • 31
Loading
added 891 characters in body
Source Link
Claudia
  • 1.7k
  • 1
  • 18
  • 31
Loading
fixed bugs and explanation
Source Link
Claudia
  • 1.7k
  • 1
  • 18
  • 31
Loading
Source Link
Claudia
  • 1.7k
  • 1
  • 18
  • 31
Loading