I am a new learner of Unix & need to understand below script as start up,
Can anyone explain the meaning of each line listed below.
First off: you shouldn't, as a beginner, even look at this script: it is very poorly written and if it really does what it is supposed to do this is out of coincidence rather than planned.
use this shell (KornShell) as commando processor
This is supposed to put the first parameter passed on command line into the variable "PARAMS", but if this parameters contains blanks this line will fail because the variable declaration is not quoted. Correct would be:
This is a comment (like everything after "#" until the end of the line).
This (and a lot of similar lines) is a waste of time and system resources. It executes a command (echo $PARAMS | cut -d: -f1) in a subshell ("`...`") and stuffs the output of this command into a variable STATUS. First, the backquotes used for the subshell are deprecated and shouldn't be used any more. Second, it too is not quoted like the first line and therefore prone to failure. To make the construct syntactically correct it should read:
But the whole thing is unnecessary altogether, because what this is supposed to do - cut the content of "$PARAMS" from the beginning to the first ":"
- can be done without a subshell by simple parameter expansion:
The same goes for all the other lines analogously.
This is simply a syntax error, because [ $EMAIL_ADDRESS > '' ] won't work. Even if it would work, using "$EMAIL_ADDRESS" unquoted would cause a runtime error if the variable contains nothing. If it is supposed to mean "as long as "$EMAIL_ADDRESS" is not empty" (which is my suspicion) it will have to be written:
Add to this that no attempt at error handling is made, parameters are not checked at all and the script has no output. I suggest you throw away this rubbish and try to write a script yourself. Even as a total beginner you will probably create something better than this.
Can anyone explain me the meaning of line #2 in these lines of shell script:
if ; then
${EXPR} " ${MACTIONS
} " : ".* ${ACTION} " >/dev/null 2>&1 || die "$USAGE"
else
Sorry in case this is a trivial thing (I am not an expert in this). (3 Replies)
Hello all,
I want to be able to create a script on the fly from another script by echoing lines into a file, but am running into difficulty, as it isn't working right. What am I doing wrong?
echo "for i in `grep $FRAME /root_home/powermt.sort.fil |awk '{print $7}'`" > pvtimout_set.sh... (5 Replies)
hello every one i want to know meaning of following line
INST_PARA=$HOME/install/Install.Para
SAVEMEDIUM=`awk '$2=="ArchiveSave"{print$4}' $INST_PARA` (4 Replies)
This may be little confusing. I have Script1, which pulls data from the system and creates another script(lets say script2). While I run script1 I need to add printf/echo statements for script2, so that when I run script2 I see those statement.
eg: script1 765
printf " display frame-$1 timeoffset... (2 Replies)
Hi,
I would like to ask about the meaning or purpose of set -e in the script bash, Does it mean if a wrong command in the script it will close or exit the script without continuation thats what happen if i set it in the terminal.
Thanks in advance (3 Replies)
What would the below code snippet mean?
my ($_configParam, $_paramValue) = split(/\s*=\s*/, $_, 2);
$configParamHash{$_configParam} = $_paramValue; (2 Replies)
Hi All,
I am new to unix shell scripting and I was documenting one of the unix script and encountered below statements -
for ii in `ls -1rt /oracle/admin/MARSCOPY/ext_files/fpm-ifpm/*.small.txt | tail -1 | awk '{print $1}'`
do
smallssim=${ii##/oracle/admin/MARSCOPY/ext_files/fpm-ifpm/}... (2 Replies)
Please let me understand the meaning of following line in unix bash scripting .is =~ means not equal to or equal to .
if ]; then
echo -e "pmcmd startworkflow -sv ${INTSERV} -d ${INFA_DEFAULT_DOMAIN} -uv INFA_DEFAULT_DOMAIN_USER" \
"-pv INFA_DEFAULT_DOMAIN_PASSWORD -usdv... (2 Replies)