Search Results

Search: Posts Made By: kazazza
12,904
Posted By kazazza
Spot on guys, thanks very much for your quick...
Spot on guys, thanks very much for your quick responses, much appreciated
12,904
Posted By kazazza
Help identifying the first word in a string
Hi all, I'd like to know how to identify the first word in a string (in bash) for e.g.

echo "enter your name"
read name
(user enters 'Joe Bloggs' for e.g.)

echo "hello $name"
(output says...
9,819
Posted By kazazza
Yes siba.s.nayak, but what if the user enters a...
Yes siba.s.nayak, but what if the user enters a first name, 2 middle names, and then a surname? Then it wont work
(https://www.unix.com/members/302025915.html)
9,819
Posted By kazazza
Thanks very much TheEngineer that worked...
Thanks very much TheEngineer that worked perfectly.

And i thank all you that have helped me

Have a good New Year!
9,819
Posted By kazazza
Thanks PMM that worked great! I'm trying to...
Thanks PMM that worked great!

I'm trying to improve this now, so that it doesn't greet everyone as "Mr." So I've made a variable called "title" (referring to Mr. Mrs. etc) my ONLY problem now is...
9,819
Posted By kazazza
When i use the code: echo "Please enter your...
When i use the code:

echo "Please enter your full name:"
read name
echo $name | awk '{print"Hello Mr." $2}'

And enter a first middle and surname e.g. john bloggs smith then it outputs 'Hello...
9,819
Posted By kazazza
The 'read first last' is a good idea but no good...
The 'read first last' is a good idea but no good if the user has a middle name. And i cant say 'read first middle last' because it wont work if the user doesn't have a middle name. Thanks for any...
9,819
Posted By kazazza
The only reason im using awk is because i was...
The only reason im using awk is because i was advised that was the best way to do this..... Is there another easier way??
9,819
Posted By kazazza
'read first last'? Sorry im new to this, could...
'read first last'? Sorry im new to this, could you explain a bit more pls?
9,819
Posted By kazazza
Hmmm, ive just asked a friend and he reckons its...
Hmmm, ive just asked a friend and he reckons its meant to be something like this:

echo "Please enter your full name:"
read name
echo "$name | awk'{print"Hello Mr.", $2}

This doesnt actually...
9,819
Posted By kazazza
Awk Command
Hi, ive got this piece of script:

echo "Enter your full name" (i.e. first and last name)
read name
echo "Hello Mr.(last name only)

How do i split the string so that it says hello and then...
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 07:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy