Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

case statement in linux scripting

 
Rocky Salve
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Rocky Salve
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no , it did not work though solution is getting closer
but goal yet to reach ...!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic