![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with while loop in shell script | rkrgarlapati | Shell Programming and Scripting | 20 | 02-02-2009 03:13 AM |
| Help shell script to loop through files update ctl file to be sql loaded | dba_nh | Shell Programming and Scripting | 1 | 04-15-2008 08:00 PM |
| Infinite Loop in Autosys while running a shell script, Manual run is fine | sharmagaurav_2k | Shell Programming and Scripting | 2 | 09-04-2007 08:20 AM |
| If then else loop in Shell script | pankajkrmishra | Shell Programming and Scripting | 4 | 07-31-2006 09:40 AM |
| Shell Script loop problem | MaxMouse | Shell Programming and Scripting | 1 | 07-26-2005 03:19 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I am taking a class in UNIX and have written a script that needs to countdown from a number that is read in from the keyboard to zero. If no number is given the start of the countdown should default to 10.
I can't get this to do the default #! /bin/sh echo Enter a number here to countdown from a number to 0 read x if [ -n $x ]; then count=$x else count=10 fi while [ $count -ge 0 ] do echo $count seconds count=`expr $count - 1` done echo Off we go! Does anyone know what I am doing wrong? |
|
||||
|
thank you
I actually realized that it had to be something similar to this last night as I had moved onto the next scrip to work on. I like UNIX scripting, but as with every other language I have taken it is the syntax that really throws me for a loop -- hee hee no pun intended.
Thank you for helping me. I will not ask for Homework help again. I don't want to get in trouble. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|