The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Getting error in command line arguments sunitachoudhury Shell Programming and Scripting 9 01-14-2009 09:13 PM
i want to list all command line arguments except naree Shell Programming and Scripting 3 03-31-2008 11:11 AM
arguments in command line rrs UNIX for Dummies Questions & Answers 6 07-28-2006 06:44 AM
command line arguments bankpro High Level Programming 3 02-02-2006 11:12 AM
Command Line Arguments roba909 UNIX for Dummies Questions & Answers 7 01-19-2006 01:46 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-06-2008
skooly5 skooly5 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 14
command line arguments

--------------------------------------------------------------------------------

I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence and it printed the value of $1 after every number. I don't want that I just want the last argument entered.



while [ $# -gt 0 ]
do
echo "$#"
shift
sleep 1s
done

echo The last command line argument you entered is $1.

can anyone help?
  #2 (permalink)  
Old 04-07-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,212
Double post questions is not allowed, please read the:

Simple rules of the UNIX.COM forums:

Continu here:

command line args 2

Thread closed.
Sponsored Links
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 07:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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