aspose file tools*
The moose likes Linux / UNIX and the fly likes case statement in linux scripting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "case statement in linux scripting" Watch "case statement in linux scripting" New topic
Author

case statement in linux scripting

Rocky Salve
Greenhorn

Joined: Apr 05, 2006
Posts: 16
hi pals

the statement

case $opt in

1|2|3)

function()
;;

...


in the above how can case be used for numbers from 1 to n
for i.e;

case $opt in

1 to n)
function()
;;
...

will that work or what is a way out
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

I tried to find a solution with seq FROM TO but without luck.
Perhaps a x -gt START && x -lt STOP (greater than, less than) is more appropriate:


Perhaps there is a better solution to make seq work.
[ April 06, 2006: Message edited by: Stefan Wagner ]

http://home.arcor.de/hirnstrom/bewerbung
Rocky Salve
Greenhorn

Joined: Apr 05, 2006
Posts: 16
no , it did not work though solution is getting closer
but goal yet to reach ...!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: case statement in linux scripting