0

if I asking for a username I have this in the file

read -p 'enter username: ' username

what can I add to make sure it comes out lowercased?

melpomene
  • 81,915
  • 7
  • 76
  • 137

1 Answers1

1

You can do

username="${username,,}"

to convert every character to lower case.

See https://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion.

melpomene
  • 81,915
  • 7
  • 76
  • 137