The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem with output of find command being input to basename command... new_learner UNIX for Dummies Questions & Answers 2 12-14-2008 02:56 AM
awk/sed Command : Parse parameter file / send the lines to the ksh export command rajan_san Shell Programming and Scripting 4 11-06-2008 01:29 PM
assign a command line argument and a unix command to awk variables sweta_doshi Shell Programming and Scripting 0 08-08-2008 07:54 AM
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 09:12 PM
inconsistent ls command display at the command prompt & running as a cron job rajranibl SuSE 5 07-30-2007 09:26 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-30-2008
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,958
Quote:
Originally Posted by Gayucvns View Post
Hi,

the awk command is very useful to print the last name. only the syntax matters. Jst try with this
echo $name | awk '{print "Hello Mr." $2}'
and that is what [ krishmaths ] posted already
  #2 (permalink)  
Old 01-05-2009
bobbygsk bobbygsk is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 90
Try this:

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

SINCE I CANNOT RECALL THE ABOVE MSG, PLS IGNORE IT.

Last edited by bobbygsk; 01-05-2009 at 12:32 PM.. Reason: Misunderstood the question
  #3 (permalink)  
Old 01-06-2009
silvermax silvermax is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 5
echo "Please enter your full name:"
read first last
echo $last

as long as the user input has a space between John & Doe then
$first=John
$last=Doe
  #4 (permalink)  
Old 01-14-2009
jroco jroco is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 13
Absolutely it's one of the best text processor AWK or GAWK whatever.

This is the correct sentences for your problem:

name="Mike Pathon"
echo $name | awk '{print "Hello Mr.", $2}'
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:35 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0