Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-24-2015, 07:49 AM   #1
LQ Newbie
Registered: Apr 2015
Posts: 1

Rep: Reputation: Disabled
Unhappy Help with 'CASE'

Hi guys,

i'm beginner with Unix, I tried my best, but I Really don't know how to finish it .

here's my problem : I have to do something like Student system - student's name | subjects | mark |credits.

after starting script it will ask you for Student's name, then which subject, then the mark will appear.

It's a homework, and I have my own idea how to solve it, but cannot finish it, i don't want complete solution, just a help!

echo "Students name"
echo -n "Enter student's name: "
read name
case $name in
Example1|Math) echo "C" ;;
Example2|Programming) echo "D" ;;
Example3|WWW) echo "A" ;;
Example4|Economie) echo "-" ;;
I don't now how to bring together case with second things which is "enter subject".

I appreciate any help
Old 04-24-2015, 08:27 AM   #2
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,880

Rep: Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489
You repeat the structure you already have... You have to prompt and read the reply.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Bash: Checking for lower case and upper case letters in a string fatalerror0x00 Programming 1 12-09-2012 03:17 AM
Help with sed and awk to change L-case letters to U-case for specific lines in a file rootaccess Linux - General 12 05-21-2012 03:50 PM
mkisofs -iso-level 1 converts to lower case instead of upper case. stf92 Slackware 3 10-29-2010 01:32 AM
Copying files from case-sensitive Linux to case-insensitive Windows via CIFS? SlowCoder Linux - General 4 05-07-2008 08:03 PM
Why are all my upper case files being shown as lower case?? [Kernel 2.6.9-1.667 FC3] t3gah Fedora 4 03-11-2005 05:09 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:02 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration