opensue 10.2 vs 11

hi all, if anyone could help me out here, may i know what is the shell different between opensuse 10.2 and 11.

when i type #man exit in both of them, one show bash builtin and another one show tcl builtin, and one of my user claimed that its because of the “exit” command in opensuse 10.2 that caused the script got problem?

#ps → and both shows

PID TTY TIME CMD
24190 pts/2 00:00:00 bash
24216 pts/2 00:00:00 ps

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

May be quicker to test your 10.x system on your own:

> rpm -qi bash

My SLED 11 x86_64 system has version 3.2. An 11.1 system next to me has
the same, so 11.0 probably does too. A SLES 10 system I have has 3.1.

Good luck.

vernon wong wrote:
> hi all, if anyone could help me out here, may i know what is the shell
> different between opensuse 10.2 and 11.
>
> when i type #man exit in both of them, one show bash builtin and
> another one show tcl builtin, and one of my user claimed that its
> because of the “exit” command in opensuse 10.2 that caused the script
> got problem?
>
> #ps → and both shows
>
> PID TTY TIME CMD
> 24190 pts/2 00:00:00 bash
> 24216 pts/2 00:00:00 ps
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJLV81NAAoJEF+XTK08PnB5OQQQAIK43TYSXbjWl7D3gMUh1GFh
BbxC12NRSA7SmUtPP+xwdGKV29uwl7RMJ6USi2f0MSUPp4aYJ5AZecYbVQkQyYix
wijsF7Zgmxm7mDgSURx6m8veQE1KlAXzk6qnNoXxv9qZ743gmltXpuUqxi87IjLN
8bwrz7TrVssY+M85H6ToaFVbwGMta+9V1E964htm+rKguniiBL/AKdfzGfCmM+yj
cNo56XQQ+Jt/7WWM5Tmmfw6Qv0Y/uTO8VlxI9Z8GJzfm3+PEr3CB6GOIcp1Iwr4a
yw9gGQIYHBrrlIh1ETAPVDMFsYAKCVty4eR9ZJKjEkiNFwMYm492tnu7H6gwiyaj
IimeoqfxSVPWW8scFZsJS8W6Syojl4Y0nahJb4sSQkoWC6KTjWTXUDeZ5YInUalg
kxQSfv3zF+Lk3qJXEhPpBKBuGobniANThXQvG29c7kX4eiTX16oWuhGxPHJ+noSR
U6kcF16MdwHEwh2Sps/OX+dfUoHq2qhqoTSjOIxLxbnmCMiBtStNkY2WP/5W5o+h
h61KEShIUITlxhdOY/xxG9846eau1UHG9yb75AhitH6xMdZ8ErkhvgeljMQH/mph
RK06Z6dm+7OM8QHhU3VyWf3LW5zkiJfcsY9swjq68gKY5s/PFIw58My1v67H/MML
EDxpNEut/Dik29Gx0abr
=2PmI
-----END PGP SIGNATURE-----

I doubt this. The priority of the man pages is not related to the order of the command searching in bash. A builtin will override any external command. And anyway the Tcl exit is only available inside Tcl programs.

To find out what exit really does, use the type command:

type exit

On my system these are the results, on exit and ls:


$ type exit ls
exit is a shell builtin
ls is aliased to `ls $LS_OPTIONS'

It could be your user aliased exit to something else. Aliases have precedence over builtins.

there is a dedicated user ID for running all the scripts. in this case, the default shell will be using csh.

i tried #type exit in the csh environment, it does not recognized the command?

Well you didn’t say you were using csh, that’s different from bash.

It’s been years since I used csh, but you can check what a command does with:

which exit

my apology, maybe i explain in brief before hand. I am the system administrator, and i do not write script.

We have 2 version of opensuse installed, 10.2 and 11. The user ID running the script will be defaulted to csh upon login.

now, trying both script, it works properly on ver 11, and some error on ver 10.2.

i check, #which exit and the result is
exit: shell built-in command. should be no problem.

part of the coding

set sdd_dir = “/net/shark/dnc_5000/sdd”
ls $sdd_dir/$JOB > /tmp/newjob.$JOB

set pho_job = “k”$JOB.pho

set newjob = “yes”
#***
perl /genesis/sys/scripts/netlist_drc_check.pl $JOB
source /tmp/netlist_drc.$JOB
rm -f /tmp/netlist_drc.$JOB
if ($user_choice == “nogo” || $ONLINE_DRC_STAT != “GREEN” || $ONLINE_NET_STAT != “GREEN” ) then
echo “$user_choice $ONLINE_DRC_STAT $ONLINE_NET_STAT”
exit ERROR

exit

endif

the script person said the error was causing by the exit command not handled the same way. In this case, it suppose to end the script, but it didnt.

Well that’s a programming error. exit in csh requires a number after it which is the exit status of the command. It should be something like:

exit $ERROR

where $ERROR is set earlier in the script or maybe

exit 1

It could be that a different version of csh behaves differently to this programming error.

marked the “exit ERROR” its still the same…

there is a main script calling some sub script, whereby a pop up screen asking for continue or quit.

when the user click quit, it suppose to end the script, this work on version 11, but in version 10.2 the sub script still continue running even the selection is “quit”

Probably another programmer error, relying on undefined behaviour of the shell.

vernon wong wrote:
> this work on version 11, but in version 10.2

i have the feeling he is not running openSUSE 10.2 and 11.x, but
rather with SUSE Linux Enterprise Server (or Desktop) version 10 SP2
or version 11

please Mr. Wong, report the results of

cat /etc/SuSE-release


palladium

kch1apwk423750 22: cat /etc/SuSE-release
openSUSE 10.2 (i586)
VERSION = 10.2

kch1apwk423762 25: cat /etc/SuSE-release
openSUSE 11.0 (i586)
VERSION = 11.0

i suppose its correct, i just wondering if there is any different among them? or there is a bug from the scripts? will the different version handle exit differently? any other command than “exit”?

the scripts involved is like this.

script1 calls script2, then script2 calls script3. script3 perform checking and if data fail, then msgbox with a OK button to quit.

for ver11, the entire script will quit with exit : Expression syntax.

for ver10.2, the script2 will continue running.

vernon wong wrote:
> openSUSE 10.2 (i586)
> VERSION = 10.2
>
> openSUSE 11.0 (i586)
> VERSION = 11.0

ok…i’ll get quiet now, again…that is, i can’t actually help with
the script error problem (not smart enough) but will note:

openSUSE 10.2 is no longer supported with security patches/updates,
and 11.0 is scheduled to go unsupported in June 2010…so, just
thought i’d mention you might wanna consider not exposing unpatched
machines to the net…


palladium

Without seeing the scripts it’s hard to tell what the problem is. But it sounds like you still have more of those “exit ERROR” programmer mistakes somewhere.