Useful website links containing linux and shell script tips

  1. Shell script tutorial links
  2.  

  3. String Manipulation

     

    • Substring Removal

      ${string#substring}
      Deletes shortest match of $substring from front of $string.
      ${string##substring}
      Deletes longest match of $substring from front of $string.
      ${string%substring}
      Deletes shortest match of $substring from back of $string.
      ${string%%substring}
      Deletes longest match of $substring from back of $string.

     

    • Substring Replacement

      ${string/substring/replacement}
      Replace first match of $substring with $replacement.
      ${string//substring/replacement}
      Replace all matches of $substring with $replacement.
      ${string/#substring/replacement}
      If $substring matches front end of $string, substitute $replacement for $substring.
      ${string/%substring/replacement}
      If $substring matches back end of $string, substitute $replacement for $substring.

  4.  

  5. Website hosting on local host

Leave a comment