![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 12:24 PM |
| Only Digits as input | namishtiwari | UNIX for Dummies Questions & Answers | 2 | 08-21-2007 03:23 AM |
| making sure input are digits | bebop1111116 | High Level Programming | 1 | 10-21-2006 02:32 PM |
| How to cut last 10 digits off | psarava | Shell Programming and Scripting | 4 | 08-29-2006 12:52 AM |
| diff. b/t chars and digits | mezzanine | Shell Programming and Scripting | 1 | 11-17-2005 09:37 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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!! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
for i in 1 2 3 4 5; do echo $i; done |
|
#3
|
||||
|
||||
|
Recent versions of bash, ksh93 and zsh:
Code:
printf "%d\n" {1..5}
|
|
#4
|
|||
|
|||
|
Thanks very much
|
|||
| Google The UNIX and Linux Forums |