Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  

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,

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...