Skip to content

Instantly share code, notes, and snippets.

@sleeyax
Last active July 9, 2022 23:16
Show Gist options
  • Save sleeyax/788f2f4790b02b5e4275b199be637b2f to your computer and use it in GitHub Desktop.
Save sleeyax/788f2f4790b02b5e4275b199be637b2f to your computer and use it in GitHub Desktop.
Simple shell script to convert text to lowercase (GNU/linux)
#!/usr/bin/sh
if ! [ -z "$1" ]
then
echo "$1" | tr '[:upper:]' '[:lower:]'
else
echo "Usage: lcs <text>"
echo 'Example: lcs "Foo Bar BAZ"'
echo "Output: foo bar baz"
fi
@sleeyax
Copy link
Author

sleeyax commented Jul 9, 2022

Installation instructions (globally, any user):

$ curl https://gist.githubusercontent.com/sleeyax/788f2f4790b02b5e4275b199be637b2f/raw/8edce505a7153712cc0edd67a3999723ddfc1549/lcs.sh -o lcs
$ sudo chmod +x lcs
$ sudo mv lcs /usr/local/bin

Restart your shell or terminal to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment