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
Grep a line with between 3 and 5 digits ceemh3 UNIX for Dummies Questions & Answers 1 09-17-2007 03:24 PM
Only Digits as input namishtiwari UNIX for Dummies Questions & Answers 2 08-21-2007 06:23 AM
making sure input are digits bebop1111116 High Level Programming 1 10-21-2006 05:32 PM
How to cut last 10 digits off psarava Shell Programming and Scripting 4 08-29-2006 03:52 AM
diff. b/t chars and digits mezzanine Shell Programming and Scripting 1 11-18-2005 12:37 AM

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 10-01-2007
Spoorthi16 Spoorthi16 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 2
Digits display

Hi there,

I am new to scripting. Can anyone help me in writing a script which will display all the digits between 1 and 5 inclusive, one digit per line. Should use a loop to do this.

Thanks in advance!!
  #2 (permalink)  
Old 10-01-2007
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
Code:
for i in 1 2 3 4 5; do echo $i; done
  #3 (permalink)  
Old 10-01-2007
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,793
Recent versions of bash, ksh93 and zsh:

Code:
printf "%d\n" {1..5}
  #4 (permalink)  
Old 10-01-2007
Spoorthi16 Spoorthi16 is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 2
Thanks very much
Sponsored Links
Closed Thread

Bookmarks

Tags
bash, zsh

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 12:36 AM.


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