Advertisement
sergio_educacionit

language.sh

Dec 19th, 2023
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.32 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. idioma=$(echo $LANG | cut -d "_" -f 1)
  5.  
  6. func_help () {
  7.  
  8.     if [ $1 == 'es' ];then
  9.  
  10.         echo "La ayuda esta en español."
  11.  
  12.     elif [ $1 == 'en' ]; then
  13.  
  14.         echo "help is in english"
  15.  
  16.     fi
  17. }
  18.  
  19.  
  20. option=$1
  21.  
  22. case $option in
  23.  
  24.     --help)
  25.         func_help $idioma
  26.         ;;
  27.  
  28.     *)
  29.         echo "Hola mundo!"
  30.         ;;
  31.    
  32. esac
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement