Answers for "lower case conversion in shell script"

1

convert all files to lowercase using shell script

#!/bin/sh

for x in `ls`
  do
  if [ ! -f $x ]; then
    continue
    fi
  lc=`echo $x  | tr '[A-Z]' '[a-z]'`
  if [ $lc != $x ]; then
    mv -i $x $lc
  fi
  done
Posted by: Guest on September-08-2020
0

bash variable lowercase

# In Bash 4.0
a=DHCP
echo "${a,,}"
# Output:
dhcp
Posted by: Guest on November-18-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language