02-01-2006
goto, as far as I know is not supported by ksh.
and besides who-ever supports it generally recommend not to use it
, so y do you want to use it. instead create functions in k-shell
function fn {
#write fn here,
#echo returnval
}
## call as below
ret_val=`fn`
# check your return value
if [ $ret_val -eq "something" ]
....
...
..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I'm trying to use the goto in ksh but it does not appear to be a valid command. Is that only valid in csh? Anything similar in ksh that I can use?
Appreciate any help you can provide.
Thanks.
geraldine (4 Replies)
Discussion started by: Geraldine
4 Replies
2. Shell Programming and Scripting
Is there a Unix (Solaris v8 ksh) version of the old basic command gosub or goto? I've researched the return command, but can't identify the command to return from. I am not trying to return from a function. Can someone give me a basic understanding of this please? Thanks so much in advance for... (3 Replies)
Discussion started by: gozer13
3 Replies
3. Shell Programming and Scripting
I have a test script for using goto statement but its not working. please help
i tried both in linux and hp-ux it's not working please help
#! /bin/ksh
t=`ps -ef|grep ti.sh|grep -v grep`
if ; then
goto start
else
goto stop
fi
start:
echo "start"
stop:
echo "stop" (5 Replies)
Discussion started by: Krrishv
5 Replies
4. UNIX for Dummies Questions & Answers
uname -a returns: SMP Tue May 17 17:52:23 EDT 2005 i686 athlon i386 GNU/Linux
I have many aliases beginning with "goto" so...
if I type goto and then hit return (oops)
A goto prompt pops up and I cant exit from it(I tried MANY key seqs)
The only way to exit is to kill the term window... (2 Replies)
Discussion started by: rairey
2 Replies
5. Solaris
Dear All,
Can any one pls let me the command for how to goback to previous visited directory from the current working directory in SunOS ?
In case of HP-UX; the same can be resolved through "cd -" command.
Thanks in advance!
Prasanth Babu. (6 Replies)
Discussion started by: prasanth_babu
6 Replies
6. Shell Programming and Scripting
Im trying to do something like this but I cant find any documentation.
read X
if
then goto ThisLine
fi
OTHER CODE
OTHER CODE
Label: ThisLine echo "You entered 1" (5 Replies)
Discussion started by: Grizzly
5 Replies
7. Shell Programming and Scripting
Hi,
I have an array with characters and I am looking for specific character in that array and if those specific character not found than I use goto statment which is define somehwhere in the script. My code is:
set a = (A B C D E F)
@ i = 0
while ($i <= ${#a})
if ($a != "F" || $a != "D")... (3 Replies)
Discussion started by: dixits
3 Replies
8. Shell Programming and Scripting
#!/bin/sh
label:
echo sql poll
v=`sqlplus -s <<!
HR/HR
set pages 0 echo off feed off
select distinct status from
emp
where
id=5;
!
`
echo $v;
echo it comes here after false
if
then
echo if condition true
sqlplus -l scott/tiger <<EOF
select * from department;
EXIT (2 Replies)
Discussion started by: kumaar1986
2 Replies
9. Shell Programming and Scripting
Hey :) I am trying to understand the command goto.
I have some questions regarding the goto manual.
1.What does the underlined part mean?
I'm not allowed to type goto in the shell? But if goto is written into a file everything is okay?
2.So if a part of my file looks like this
...
goto... (8 Replies)
Discussion started by: orbit
8 Replies
10. Shell Programming and Scripting
Well, guys I saw a question about GOTO for Python.
So this gave me the inspiration to attempt a GOTO function for 'dash', (bash and ksh too).
Machine: MBP OSX 10.14.3, default bash terminal, calling '#!/usr/local/bin/dash'...
This is purely a fun project to see if it is possible in PURE... (3 Replies)
Discussion started by: wisecracker
3 Replies
LEARN ABOUT NETBSD
krb5_appdefault_boolean
KRB5_APPDEFAULT(3) BSD Library Functions Manual KRB5_APPDEFAULT(3)
NAME
krb5_appdefault_boolean, krb5_appdefault_string, krb5_appdefault_time -- get application configuration value
LIBRARY
Kerberos 5 Library (libkrb5, -lkrb5)
SYNOPSIS
#include <krb5/krb5.h>
void
krb5_appdefault_boolean(krb5_context context, const char *appname, krb5_realm realm, const char *option, krb5_boolean def_val,
krb5_boolean *ret_val);
void
krb5_appdefault_string(krb5_context context, const char *appname, krb5_realm realm, const char *option, const char *def_val, char **ret_val);
void
krb5_appdefault_time(krb5_context context, const char *appname, krb5_realm realm, const char *option, time_t def_val, time_t *ret_val);
DESCRIPTION
These functions get application defaults from the appdefaults section of the krb5.conf(5) configuration file. These defaults can be specified
per application, and/or per realm.
These values will be looked for in krb5.conf(5), in order of descending importance.
[appdefaults]
appname = {
realm = {
option = value
}
}
appname = {
option = value
}
realm = {
option = value
}
option = value
appname is the name of the application, and realm is the realm name. If the realm is omitted it will not be used for resolving values.
def_val is the value to return if no value is found in krb5.conf(5).
SEE ALSO
krb5_config(3), krb5.conf(5)
BSD
July 25, 2000 BSD