Sponsored Content
Top Forums Shell Programming and Scripting How to tell which shell is running a script Post 302364739 by cfajohnson on Friday 23rd of October 2009 06:07:38 PM
Old 10-23-2009
Quote:
Originally Posted by sbaker
I'm hoping to find somethat that will tell me "sh" or "ksh" or whatever shell is actually interpreting the script.

It's better to test whether the current shell has the features your script needs.
 

10 More Discussions You Might Find Interesting

1. Solaris

Running from Shell Vs running from RC script

Hi, i have a script which need to do behave differently when run as a startup process from init.d/ rc2.d script and when run manually from shell. How do i distinguish whether my script is run by init process or by shell?? Will the command /proc/$$/psinfo | grep "myscript" work well???... (2 Replies)
Discussion started by: vickylife
2 Replies

2. UNIX for Advanced & Expert Users

shell script not running

Dear Friends, OS: REDHAT ENTERPRISE LINUX ,nash version I am facing a peculier type of problem.A bash script ran yesterday does not run successfully today . Absolutely giving NO OUTPUT AT ALL. We have migrated recently from redhat linux 9 to REDHAT ENTERPRISE LINUX 4.4 recently .What... (3 Replies)
Discussion started by: vakharia Mahesh
3 Replies

3. Shell Programming and Scripting

running a shell script

sometimes while running a shell script we use ksh -c '....script' what is the significance of ksh -c here .... what if i run the script only.what is the difference (6 Replies)
Discussion started by: dr46014
6 Replies

4. Shell Programming and Scripting

Shell script running command in different shell

Hi All, Is there any way where we can run few commands with different shell in a shell script ? Let's have an example below, My first line in script reads below, #!/bin/sh However due to some limitation of "/bin/sh" shell I wanted to use "/bin/bash" while executing few... (9 Replies)
Discussion started by: gr8_usk
9 Replies

5. Shell Programming and Scripting

Bash shell script to check if script itself is running

hi guys we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
Discussion started by: hedkandi
8 Replies

6. Shell Programming and Scripting

Shell Script for continuously checking status of a another script running in background, and immedia

Hi, I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help.. i am using below command to run script nohup system_traps.sh & but in some... (9 Replies)
Discussion started by: ketanraut
9 Replies

7. Shell Programming and Scripting

Shell Script is not running

Hi, when iam running below command it is executing fine on my linux command prompt. java -jar Efile.jar but the same command iam using in Shell script it doesnt work and saying error Unable to access jar files. Flavour is Linux Redhat. pls help (1 Reply)
Discussion started by: Riverstone
1 Replies

8. Shell Programming and Scripting

Changing shell from a script and running something from the new shell

Hi We use "tcsh" shell . We do the following steps manually: > exec ssh-agent zsh > python "heloo.py" (in the zsh shell) I am trying to do the steps above from a shell script This is what I have so far echo "Executing " exec ssh-agent zsh python "hello.py" exit 0 Problem is... (5 Replies)
Discussion started by: heman82
5 Replies

9. Shell Programming and Scripting

Running 3 shell script parallel in another shell script

Hi, I'm trying to do teh below thing. I have a single script which uses 3 different parameters to do 3 different work like belwo. test1.sh par1 -- it shuts down an instance test1.sh par2 -- it shuts down an instance test1.sh par3 -- it shuts down an instance Now I created a script... (7 Replies)
Discussion started by: bhaski2012
7 Replies

10. Shell Programming and Scripting

Cp not working in shell script but running perfectly from shell

Dear All, I have script. Dest="" IFS=' ' for translation in $(echo $MY_MAP) do t1=$(echo $translation | cut -d"=" -f1) t2=$(echo $translation | cut -d"=" -f2| cut -d"," -f1) if then Dest=$UNX/$u_product_path/$u_study_path/$UNXTR/$t2 break; ... (4 Replies)
Discussion started by: yadavricky
4 Replies
xlator_call(8)						      System Manager's Manual						    xlator_call(8)

Name
       xlator_call - shell script to invoke PostScript translators

Syntax
       xlator_call datatype orientation pagesize width length indent

Description
       This  Bourne  shell script can be called by the line printer daemon to invoke the appropriate translator to convert each data type to Post-
       Script.	The data type passed by may be specified by using the command with the -Ddatatype option, or by using the  Da=datatype	capability
       in the file.

       For a file in a data syntax to be translated to PostScript, the script must contain a case branch which recognizes the data type string and
       calls a suitable filter.  The supplied recognizes the ANSI, ASCII, ReGIS and Tektronix 4014 data types.

Arguments
       datatype
       The valid data types are: or any other for which a translator has been installed.

       orientation
       The valid orientations are: portrait or landscape.

       pagesize
       The valid page sizes are: or

       width
       The width (in characters) of the page.

       length
       The length (in lines) of the page.

       indent
       The amount (in spaces) the output is to be indented.

       All the valid arguments are described in detail by the reference page.

Examples
       An example shell script is shown below:
       case $datatype in
       ansi)
	    exec ansi_ps -F $pagesize -O $orientation -e "$@";;
       ascii)
	    echo "(04) cvn {} def"
	    exec ln03rof -w$width -l$length -i$indent;;
       postscript)
	    exec cat;;
       tek4014)
	    exec tek4014_ps -F $pagesize -O $orientation;;
       regis)
	    exec regis_ps -F $pagesize -O $orientation;;
       *)
	    echo "$0: Translator for data type $datatype not installed" >&2
       esac

       When the shell script is called, the path searched is:
       /usr/local/lib/lpdfilters:/usr/ucb:/bin:/usr/bin:
				   /usr/lib:/usr/lib/lpdfilters

Files
       The				       script

See Also
       lno3rof(8), printcap(5), ansi_ps(8), lpd(8)

																    xlator_call(8)
All times are GMT -4. The time now is 03:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy