![]() |
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 |
| counter problem | jwholey | Shell Programming and Scripting | 2 | 03-19-2008 04:39 PM |
| echo problem | tontal | Shell Programming and Scripting | 1 | 11-16-2006 06:36 AM |
| echo problem | abrd600 | Shell Programming and Scripting | 5 | 02-14-2005 06:24 PM |
| Increment counter in ksh | steiner | Shell Programming and Scripting | 5 | 12-02-2003 08:10 AM |
| `echo` problem. | Cameron | UNIX for Dummies Questions & Answers | 1 | 12-29-2001 04:36 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Simple script trying to increment a counter within an echo statement never gets past 1 - PLEASE HELP!
Thanks. ~~~~~~~~~~~ #!/bin/sh stepup() { STEP=`expr $STEP + 1` echo $STEP } # # Initialize variables # STEP=0 echo "Counter Value: `stepup`" echo "Counter Value: `stepup`" echo "Counter Value: `stepup`" echo "Counter Value: `stepup`" echo "Counter Value: `stepup`" echo "Counter Value: `stepup`" echo "Counter Value: `stepup`" echo "Counter Value: `stepup`" echo "Counter Value: `stepup`" echo "Counter Value: `stepup`" |
|
||||
|
Is there any way to evaluate the function "stepup" and echo/print it out in one statement or are we stuck doing 2 separate statements - one to evaluate the function and another to display it. Is there a way to do it within the function (ie, return)?
Thanks. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|