We will assume that you understand that invoking script and invoking script.sh do not run the same code.
Most BSD, Linux, and UNIX systems have a utility named script installed. If you name your shell script script, whether you will invoke your shell script or the system's script utility will depend on which will be found first in the directories named by the PATH variable in your current shell execution environment.
If your script is named script and the directory containing your script is found in the PATH environment variable before the system's script utility, having the first thing that your code does be:
creates a recursive sequence of invocations of your script until you exceed that number of processes you are allowed to have running with your user ID, the system runs out of available resources to create another copy of your process, or a system administrator kills your job when other users on your system complain that you are slowing down their jobs by unreasonably consuming all available system resources.
Hi,
I wrote a script to get the oldest file from a directory path (which is passed as a parameter to the script)
#########################################################
XMLFILE_PATH={$1}
cd $XMLFILE_PATH
JPM_FILENAME = `(ls -tr User* | head -1)`
#echo $JPM_FILENAME
###### END... (1 Reply)
I'm sure this is a simple thing but I can't figure it out. In a script that I'm writing, I'd like to be able to store each line of output from "ls -l" into a variable. Ultimately I'd like to end up with something like:
for a in `ls -l`
do something with $a
doneBut that's reading each... (2 Replies)
Hi,
I work in ksh88.
I have an interective script which prompts the user for the input and returns numeric value depending on the input provided. I need to call this script inside another script and then assign the resulting output the the variable.
The call like that A=`my script` obviously... (6 Replies)
Hi,
I need to parse a simple text file like below and store the word that starts with BR* to a variable say $BRno. I need to do this in sh script.
NOTE: the length of the numbers following BR is not constant (eg: it could be BR1234 or BR22233). And there is only 1 BRxxxxx in a file at a given... (6 Replies)
When script is running you only see when some of the commands are not successfull.
Is there a way to see which command are executed and to show the substitution of variables as every line is executed ? (3 Replies)
Hi,
We Perfrom Loads to the database through a Perl script which generates a statistics file. I need to read the statistics. the Statistics file looks something like below:
Process Beginning - 08-26-2010-23.41.47
DB2 CONNECTION SUCCESSFUL!
Ready to process and load file: FILENAME
# of... (2 Replies)
Hi guys
I am calling one DB2 stored proc through unix. It is giving me below output. I want to capture the value 150 in one UNIX variable in shell script. Please let me know how I can achieve this. Thanks in advance
Value of output parameters
--------------------------
Parameter Name :... (5 Replies)
I'm running a matlab code within a shell script. This is how I do it,
matlab -nodesktop -nosplash -nojvm -r "my_program;quit"
This works fine. My matlab code prints out a single number, say "ans = 10" for example. I want to assign this to a variable in the shell script.
I tried doing this... (18 Replies)
Hi Guys!
I'm trying to get this script going but running into a little issue. not sure what is going on.
basicly how i'm writing this script is to ask you what is the password you want to be encrypted, then ask you what the user id is, takes that info run's the encryption script with the... (2 Replies)
Hi- I am returning output of an query into a array variable in my shell script.
set -A DATE_RANGE `sqlplus -s **/**@** << EOF
set termout off
set echo off
set serveroutput off
set pagesize 0
set linesize 500
set heading off
set verify off
set feedback off
select... (1 Reply)