im newbie, im trying something, but cannot figure out how to bring together case with 2 inputs.
Something like "enter your name" and "enter your age".
I had idea but dont now how to finish it as I said i'm just a beginner.
Code:
#!/bin/bash
echo "Name"
echo -n "Enter your name: "
read name
echo -n "enter your age: "
read age
echo
case $name,$age in
"Thomas Muller"|35) echo "you are too old" ;;
"Luka modric"|28) echo "you are boring" ;;
esac
when i try it nothing happens, I had idea how i can solve it in pascal nad converted it to bash, but i really dont know if it is possible.
Code:
if [ "$name" == "name" ] && [ "$age" == "age" ]; then
echo "$age";
$ name="carlo"
$ age="old"
$ case ${name}${age} in
> "carloold") echo "You are old and grumpy" ;;
> *) echo "You're not me" ;;
> esac
You are old and grumpy
$ name="carlo"
$ age="old"
$ case ${name}${age} in
> "carloold") echo "You are old and grumpy" ;;
> *) echo "You're not me" ;;
> esac
You are old and grumpy
Yes dear Carlo something like this, if he enter the name for exmaple Thomas Muller, but the age is not correct the echo "you are too old" will not appear.
i'm just learning bash and looking for tutorials. am I on the right way?
Hi all,
I am trying to find a way to change first letter in a word from lower case to upper case. It should be done for each first word in text or in paragraph, and also for each word after punctuation like
. ; : ! ?I found the following command
sed -i 's/\s*./\U&\E/g' $@ filenamebut... (7 Replies)
Hello Unix Gurus :
It would be really appreciative if can find a solution for this .
I have records in a file .
I need to Capitalize the records based on condition .
For Example i tried the following Command
COMMAND -->
fgrep "2000YUYU" /export/home/oracle/TST/data.dat | tr '' ''... (12 Replies)
Is there a command that can switch a character variable from UPPER case to lower case?
like
foreach AC ( ABC BCD PLL QIO)
set ac `COMMAND($AC)`
...
end
Thanks a lot! (3 Replies)
Hi
I want to make string substitution ignoring case for search but respecting case for subtitute. Ex changing all occurences of "original" in a file to "substitute":
original becomes substitute
Origninal becomes Substitute
ORIGINAL becomes SUBSTITUTE
I know this a little special but it's not... (1 Reply)
Hi all,
i have a data array as followes.
ARRAY=DFSG345GGG
ARRAY=234FDFG090
ARRAY=VDFVGBGHH
so on..........
i need all english letters to be change to lower case. So i am expecting to see
ARRAY=dfsg345ggg
ARRAY=234fdfg090
ARRAY=vdfvgbghh
so on........
If i have to copy this data in... (8 Replies)
Hi All
I have a script which extracts values from a Database (A persons name) and puts it into a variable in my script IE: $NAME
However the Value in the DB is all in uppercase and contains the users first name and last name
EG:
> echo $NAME
GRAHAM BOYLE
>
What I need is only the... (7 Replies)
HELLO ALL,
URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE.
FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY
and the CITY column records will be: Newyork
washington
... (1 Reply)