Sponsored Content
Top Forums UNIX for Advanced & Expert Users Running scripts without a hashbang - ksh anomaly? Post 302911269 by neutronscott on Wednesday 30th of July 2014 10:16:36 PM
Old 07-30-2014
With the shebang, the OS loads the interpreter. without the shebang, the shell implements this. Must be how ksh93 copies the environment, overwriting the parent's without zeroing it first? Just looking briefly, it may start with sh_fork()/ sh_ntfork() in xec.c
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

executing variables in ksh scripts?

In a ksh script on an AIX box running a jillion oracle database processes, I'm setting a variable to one of two possible arguments, depending on cmd line arguments. FINDIT="ps -ef | grep oracle | grep DBexport | grep rshrc" -or- FINDIT="ps -ef | grep oracle | grep prod | grep runback" I... (3 Replies)
Discussion started by: zedmelon
3 Replies

2. Shell Programming and Scripting

converting ksh scripts to sh

Hello All, I have a whole bunch of shell scripts written in a ksh environment and which successfully execute there. However, I found out that they eventually need to be used in a sh environment. So some commands like some_variable=$(some_command) fail because sh doesn't understand $(.....). I... (11 Replies)
Discussion started by: sherkaner
11 Replies

3. Shell Programming and Scripting

Running scripts via su

Hi All, Am using the below command to start my application using the root user su - bin -c "/home/bin/test/start.sh" but am getting the error becaue i have set some environment varibales in bin .profile when i execute the command start.sh by logging directly into bin account it's... (8 Replies)
Discussion started by: ravi.sri24
8 Replies

4. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

5. Shell Programming and Scripting

Ksh Associating scripts

Im writing a script in the Ksh, as the title suggests. OK so im sincerely tring to be lazy. Im trying to make a script that will use another file as a sort of variable library So basically i dont need to include the variables themselves, just want to make a reference to the file, so the... (2 Replies)
Discussion started by: Demon002
2 Replies

6. 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

7. Shell Programming and Scripting

hashbang line

Hi All, I am new to this forum. I would really appreciate if some one from you expert team could answer my qns: 1) whats the difference between the below commands. what events occur in the background when I fire each of the three commands. >./script.ksh >sh script.ksh >script.ksh ... (11 Replies)
Discussion started by: agrawal.prachi
11 Replies

8. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

9. Shell Programming and Scripting

Restrict access to .ksh scripts

Hi, How to restrict access to a .ksh script in such the way that the users can only execute the script, neither read nor write. I tried the below code so that my user alone has the rwx and other users can only execute. chmod 711 sample.ksh But when I logged in as a different user... (26 Replies)
Discussion started by: machomaddy
26 Replies
builtin(1)							   User Commands							builtin(1)

NAME
builtin - ksh93 built-in function to add, delete, or display shell built-ins SYNOPSIS
builtin [-ds] [-f lib] [pathname ...] DESCRIPTION
The ksh93 builtin command adds, deletes, or displays built-in commands in the current shell environment. A built-in command executes in the current shell process and can have side effects in the current shell. On most systems, the invocation time for built-in commands is one or two orders of magnitude less than commands that create a separate process. For each pathname specified, the basename of the pathname determines the name of the built-in. For each basename, the shell looks for a C level function in the current shell whose name is determined by pre-pending b_ to the built-in name. If pathname contains a forward slash (/), the built-in is bound to pathname. A built-in bound to a pathname is only executed if pathname is the first executable found during a path search. Otherwise, built-ins are found prior to performing the path search. If pathname is not specified, builtin displays the current list of built-ins, or just the special built-ins if the -s option is specified, on standard output. The full pathname for built-ins that are bound to pathnames are displayed. Libraries containing built-ins can be specified with the -f option. If the library contains a function named lib_init(), this function is invoked with argument 0 when the library is loaded. The lib_init() function can load built-ins by invoking an appropriate C level function. In this case there is no restriction on the C level function name. The C level function is invoked with three arguments. The first two are the same as main() and the third one is a pointer. The ksh93 builtin command cannot be invoked from a restricted shell. OPTIONS
The following options are supported: -d Delete each of the specified built-ins. Special built-ins cannot be deleted. -f lib On systems with dynamic linking, load and search for built-ins in the shared library, lib. Libraries are searched for in $PATH and system dependent library directories. The system dependent shared library prefix or suf- fix can be omitted. Once a library is loaded, its symbols become available for the current and subsequent invocations of builtin. Multiple libraries can be specified with separate invocations of builtin. Libraries are searched in the reverse order in which they are specified. -s Display only the special built-ins. OPERANDS
The following operands are supported: pathname Specifies the pathname. The basename of the pathname determines the name of the built-in. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. EXAMPLES
Example 1 Loading a builtin Command The following example loads a builtin command mycmd from the library libfoo.so: example% builtin -f foo mycmd AUTHORS
David Korn, dgk@research.att.com ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Uncommitted | +-----------------------------+-----------------------------+ SEE ALSO
ksh93(1), whence(1), attributes(5) SunOS 5.11 1 May 2007 builtin(1)
All times are GMT -4. The time now is 03:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy