Jump to content

Bash script


Recommended Posts

Hi,

I need help with my script that needs to write a letter (a or f) for english and french to a file and then I need to read that letter to create a variable named $language.

Im totally lost! lol

Thanks in advance,

Link to comment
Share on other sites


nevermind I found it :)

exec 3<> ~/sdelrc
read langue <&3
exec 3>&-

this will read the first line of sdelrc and create a variable named $langue with it !

ps: I have another question !

Is it possible to use a case inside a case ? Because Im getting a error with this ...

echo "Quel langue? / What language? (F)rançais / (E)nglish?:"
read language
case "$language" in
"f"|"F" )
echo f > ~/sdelrc
echo "Écraser le fichier SpecFICH (O)ui , (N)on?:"
read confirmation
case $confirmation in
"o"|"O" )
mv -f $1 ~/corb.dir
;;
"n"|"N" )
exit 0
;;
esac
"a"|"A" )
echo a > ~/sdelrc
echo "Overwrite file FILESpec (Y)es , (N)o?:"
read confirmation
case $confirmation in
"o"|"O" )
mv $1 ~/corb.dir
;;
esac
esac

Edited by ronmanp
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...