![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl + array and incrementing number | Optimus_P | Shell Programming and Scripting | 5 | 07-18-2008 02:55 AM |
| Port incrementing using one file | coolkid | Shell Programming and Scripting | 0 | 06-05-2008 01:42 PM |
| shell script help: sorting, incrementing environment variables and stuff | secoif | Shell Programming and Scripting | 1 | 05-08-2008 07:04 AM |
| New iteration of for-loop without incrementing? | jeriryan87 | Shell Programming and Scripting | 0 | 07-02-2007 02:13 PM |
| incrementing a for loop | run_time_error | Shell Programming and Scripting | 2 | 03-28-2005 02:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Port num incrementing
Hello Guyz
These days Iam doing pretty good scripting work that is all because of you fellas.Thank you so much. As it goes ,here comes my next problem.Iam trying to implement automatic port number incrementing. For ex: demo() { echo "Enter for default port[56]: read port if [[ -z $port ]] #if we didnt enter any thing ,it will take 56 then $port=56 fi } do u want re-run it(y/n): read ans if [[ "$ans" = "y" ]] then demo else exit ------------------------- This is the code I have so far,what iam trying to do is when ever we re-run the "demo" the port number has to increment by 1.In this case it has to go to 57. For ex:echo "Enter for default port[57]: Two things are worrying me now 1)How do i increment to 57 , and make it as default value(if we press enter,it has to take 57) 2)check the port number,if the port number is not available ,hw do we detect it and assign the next available port to default. These are the things bothering me now.Hope you can help me with these things guyz. --CoolKid |
|
||||
|
Gotcha.....it is working good..Thanks a lot pal.
![]() |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|