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
  • 84,125
  • 8
  • 85
  • 148

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
  • 84,125
  • 8
  • 85
  • 148