[CentOS] Shell Script Question

2008-07-09 Thread Joseph L. Casale
What's the simplest way to increment the number up by one until some other 4 digit number while preserving leading zero's until the 1000's has a digit other than 0? Thanks! jlc ___ CentOS mailing list CentOS@centos.org

Re: [CentOS] Shell Script Question

2008-07-09 Thread Steve Thompson
On Wed, 9 Jul 2008, Joseph L. Casale wrote: What's the simplest way to increment the number up by one until some other 4 digit number while preserving leading zero's until the 1000's has a digit other than 0? In zsh, it would be something like: for i in {..}; do echo $i

Re: [CentOS] Shell Script Question

2008-07-09 Thread Stephen John Smoogen
On Wed, Jul 9, 2008 at 6:22 PM, Joseph L. Casale [EMAIL PROTECTED] wrote: What's the simplest way to increment the number up by one until some other 4 digit number while preserving leading zero's until the 1000's has a digit other than 0? Your homework done in a snap! for (i=0;

RE: [CentOS] Shell Script Question

2008-07-09 Thread Joseph L. Casale
Your homework done in a snap! Lol, nah, not homework :P I don't know what I was thinking, long day. OTH, I never seq could do this as well! Thanks! jlc ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos

Re: [CentOS] Shell Script Question

2008-07-09 Thread Stephen Harris
What's the simplest way to increment the number up by one until some other 4 digit number while preserving leading zero's until the 1000's has a digit other than 0? Lots of answers, depending on the shell. I like this version for ksh: typeset -Z4 a=-1 while (( a++ 1000 )) do

Re: [CentOS] Shell Script Question

2008-07-09 Thread Les Bell
Joseph L. Casale [EMAIL PROTECTED] wrote: What's the simplest way to increment the number up by one until some other 4 digit number while preserving leading zero's until the 1000's has a digit other than 0? Easy: $ seq -f %04g Best, --- Les Bell, RHCE, CISSP

Re: [CentOS] shell script question

2008-03-16 Thread Marcelo Roccasalva
On Thu, Mar 13, 2008 at 12:04 PM, Jerry Geis [EMAIL PROTECTED] wrote: hi all, If I have a shell script on 5.1 that has 2 commands in the script... command1 command2 and command1 runs until it is kill'ed by some other process. Sometimes command2 runs and sometimes it doesnt (this is what

[CentOS] shell script question

2008-03-13 Thread Jerry Geis
hi all, If I have a shell script on 5.1 that has 2 commands in the script... command1 command2 and command1 runs until it is kill'ed by some other process. Sometimes command2 runs and sometimes it doesnt (this is what it seems like). How can I be ensured that command2 will always run after

Re: [CentOS] shell script question

2008-03-13 Thread Fajar Priyanto
On Thursday 13 March 2008 22:04:23 Jerry Geis wrote: If I have a shell script on 5.1 that has 2 commands in the script... command1 command2 and command1 runs until it is kill'ed by some other process. Sometimes command2 runs and sometimes it doesnt (this is what it seems like). How can I

Re: [CentOS] shell script question

2008-03-13 Thread Garrick Staples
On Thu, Mar 13, 2008 at 11:04:23AM -0400, Jerry Geis alleged: hi all, If I have a shell script on 5.1 that has 2 commands in the script... command1 command2 and command1 runs until it is kill'ed by some other process. Sometimes command2 runs and sometimes it doesnt (this is what it

Re: [CentOS] shell script question

2008-03-13 Thread Garrick Staples
On Thu, Mar 13, 2008 at 10:29:58PM +0700, Fajar Priyanto alleged: On Thursday 13 March 2008 22:04:23 Jerry Geis wrote: If I have a shell script on 5.1 that has 2 commands in the script... command1 command2 and command1 runs until it is kill'ed by some other process. Sometimes