Re: Another question
From: Stephane CHAZELAS (stephane_chazelas_at_yahoo.fr)
Date: 04/25/03
- Next message: John W. Krahn: "Re: Newbie"
- Previous message: Stephane CHAZELAS: "Re: Another question"
- In reply to: Good guy: "Re: Another question"
- Next in thread: Stephane CHAZELAS: "Re: Another question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 25 Apr 2003 10:53:45 GMT
Good guy wrote:
[...]
> How can I detect if counter is bigger than 5? ( if ( test $counter > 5 ) is
> not correct, isn't it?
POSIX way is
if [ "$counter" -gt 5 ]; then ...
bash/ksh/zsh way is
if (( counter > 5 )); then ...
> How can i show the results in a printf ? (my implementation gives me a [1]:
> Invalid number
Same as your other error: ${c[1]} instead of $c[1]
How is it that you need arrays and arithmetic in a script. My
guess is that you'd need a programming language here instead of
a shell.
-- Stéphane
- Next message: John W. Krahn: "Re: Newbie"
- Previous message: Stephane CHAZELAS: "Re: Another question"
- In reply to: Good guy: "Re: Another question"
- Next in thread: Stephane CHAZELAS: "Re: Another question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|