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 > 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
command line args 2 skooly5 UNIX for Dummies Questions & Answers 2 04-06-2008 09:36 PM
Command line args enuenu High Level Programming 2 05-29-2007 12:19 AM
alias with args how to ... umen UNIX for Dummies Questions & Answers 4 12-28-2005 07:47 AM
required command line args yoi2hot4ya UNIX for Dummies Questions & Answers 6 06-02-2005 06:50 PM
Args to Array Shaz Shell Programming and Scripting 2 06-30-2003 04:11 PM

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 04-06-2008
skooly5 skooly5 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 14
command line args

I am trying to print command line arguments one per second. I have this

while [ $# -gt 0 ]
do

echo "6"
shift
echo "5"
shift
echo "4"
shift
echo "3"
shift
echo "2"
shift
echo "1"
shift

done

but when i run it like this it just prints them all at once:
6
5
4
3
2
1

and I want a 1 second pause between numbers.

Anyone?
  #2 (permalink)  
Old 04-06-2008
rubin's Avatar
rubin rubin is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2007
Posts: 321
Code:
sleep 1
Try man sleep, and use $# again to simplify your code.
  #3 (permalink)  
Old 04-06-2008
skooly5 skooly5 is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 14
thanks that worked.
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 10:17 AM.


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