Need help wirh scripting arrays in bash

Need help wirh scripting arrays in bash

Post by kfeagin » Mon, 08 May 2000 04:00:00



I am in school and I have finished all projects except this one:

Write a script which passes a series of numbers, which will output one line
odd numbers the second line even numbers.

 I have figured that if I use the script expr`$num % 2`= $num1
 then if it was 0 that would be even. I must do the in the bash shell.

Any help would be greatly appreciated.

Kevin
ps: From all the other help I see given here you all do a great job, thanks

 
 
 

Need help wirh scripting arrays in bash

Post by Ken Pizzi » Sun, 14 May 2000 04:00:00



>I am in school and I have finished all projects except this one:

>Write a script which passes a series of numbers, which will output one line
>odd numbers the second line even numbers.

> I have figured that if I use the script expr`$num % 2`= $num1
> then if it was 0 that would be even. I must do the in the bash shell.

"[M]ust do in the bash shell", as in "cannot call any external
commands"?  Then I suggest using the "case" command.  Another
hint: all odd numbers (when expressed in base 10) end in one of:
  1 3 5 7 9

                --Ken Pizzini

 
 
 

1. BASH BASH BASH BASH BASH BASH BASH BASH BASH BASH

Is there a proper fixed bash on any of the FTP sites out there?

I know there bash is on the usual sites but I don't know if they are
bugged or not :(

Regards,

Neil.

--


------------------------------------| Edinburgh, EH14 2DE, United Kingdom
**Domino: There`s nothing you can do when you`re the next in line: Domino**

2. HELP, New user

3. Bash shell script array question?

4. Burn Backups?

5. bash array scripting problem

6. Which is the best linux !!!

7. arrays in bash script

8. X uses MORE than 60 Megs!?!? (newbie)

9. using arrays in my bash script, having problems

10. Need help with bash script to isolate a portion of an output

11. Passing option to bash script help needed

12. Need help on bash scripting

13. bash script, need help ! Please!