KSH doubt !!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting KSH doubt !!!
# 1  
Old 10-27-2001
KSH doubt !!!

Hello !

Dears, somebody could say me how can I use the command
"goto" in the korn shell (ksh) script ??

In the site "www.kornshell.com", we see that the syntax is:
goto my_label
...
my_label:

However when I use this syntax, the following error occurs:
goto: not found

Somebody can help me?

Danke
Wittgeinster
witt
# 2  
Old 10-27-2001
The korn shell does not have a "goto". I looked on that site and I could find no claim to the contrary. Could you post the exact url where you found the goto syntax?
# 3  
Old 10-27-2001
The URL is : http://cdfinfo.in2p3.fr/Services/Inf...OCU/munix.html

Press Ctrl+F and type goto ...

Danke,
Wittgeinster
witt
# 4  
Old 10-28-2001
That is just a web site with an error. But that's quite a bit different than your original comment that www.kornshell.com said that. www.kornshell.com is Dr. Korn's own website. It would be very strange indeed for him to make that error.
# 5  
Old 10-29-2001
goto USE CASE

Witt,

A very nice construct that is far superior to GOTO is CASE. CASE also prevents dead ends and allows for many outcomes depending on the variable.

You can set it up to have infinite conditions, 256 max I believe, to perform various tasks depending on the input to the CASE statement.

Just define $VAR above from some action and CASE will do the rest!


case $VAR in

VAR1 ) Do some statement ;;

VAR2 ) Do different statement ;;

VAR3 ) Do another different statement;;

* ) Do default statement and exit from CASE ;;

esac





Smilie Smilie
# 6  
Old 10-29-2001
Thank you Kelam_Magnus !!

Perderabo,
so that I could have access that one hyperlink, I made the following procedure :

www.kornshell.com
hyperlink : Resoursces
hyperlink : Unix KornShell Memento

Thank you !!

Witt
witt
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Doubt

in my shell script requirement is to search and replace the file with variable so i use the following command sed -i "s/abc/$SCHEMA/g" table.sql later when the script runs sqlplus username/pwd@Table& this & is not letting the variable to replace the value inside the file .please let me know... (1 Reply)
Discussion started by: bhuvan1
1 Replies

2. Ubuntu

Doubt

hi ,, i am new for this.. i want to know abt linux os.. which version is best for it industry.. please suggest me..:cool: (1 Reply)
Discussion started by: c vignesh kumar
1 Replies

3. Shell Programming and Scripting

Doubt

Hi, I have a file with multiple entries and I have calculated the percentages. Now I want to know how many of my entries are there between 1-10% 11-20% and so on.. chr1_14401_14450 0.211954217888936 chr1_14451_14500 1.90758796100042 chr1_14501_14550 4.02713013988978... (1 Reply)
Discussion started by: Diya123
1 Replies

4. UNIX for Advanced & Expert Users

doubt in df -h

in my parition i hav parition like this Filesystem Size Used Avail Use% Mounted on /dev/sda2 24G 22G 756M 97% / /dev/sda5 248G 1.2G 234G 1% /else /dev/sda1 965M 24M 892M 3% /boot tmpfs 7.0G 0 7.0G 0%... (1 Reply)
Discussion started by: ponmuthu
1 Replies

5. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

6. Shell Programming and Scripting

One doubt

Hi, Can i use the shell script like this? When i am running the script it is hanging not giving me any output. I can redirect the output and then i can do the manipulations also but why this one is wrong. I am confused we can do like this or not.. #!/usr/bin/ksh for line in `top` do... (2 Replies)
Discussion started by: namishtiwari
2 Replies
Login or Register to Ask a Question