12-05-2008
test: unknown operator status
hi
I get test: unknown operator status
if [ $status = "A" ]
then
echo "OK."
return 0
else
echo "not ok" 2>&1
exit -1
fi
I tried to change "A" with 'A' --> same error
I tried to change
if [ "$status" = "A" ], I am getting:
-1: bad number
any idea?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have gotten the script up to this point and it works fine a system but when i copy it to another unix server running solaris 9 as the original one , its gives an error './mon_fs.sh: 0: unknown test operator' .
(see script bellow)
can the Gurus see to this as i am just a beginner with... (2 Replies)
Discussion started by: ibroxy
2 Replies
2. UNIX for Advanced & Expert Users
Hi,
I have the following shell script :
Nbr_BD_Link=0
Nbr_BD_Link=`
sqlplus sysadm/${PSWD}@${DB_Name} << EOF | tail -4 | head -1 2>/dev/null
set head off feedback off ;
select count(*) from dba_db_links ;
exit ;
EOF `
echo ${Nbr_BD_Link}
if ; then
... (4 Replies)
Discussion started by: big123456
4 Replies
3. Shell Programming and Scripting
Hi
I want to group
like this but syntactic is not right ...
Thanks
if
Like this below does not work properly ..
if
then
:
else
usage
exit 1
fi (5 Replies)
Discussion started by: zam
5 Replies
4. Shell Programming and Scripting
Hi All,
can some one figure out the syntax issue here. How to overcome this?
#!/bin/sh
$ HFR_MAIL=NO
$ PRP_MAIL=NO
$ MC_MAIL=NO
$ if && && ]; then
> echo "NO "
> else
> echo "YES"
> fi
test: unknown operator NO
$ if && && ]; then
> echo "NO"
> else
> echo "YES"
>... (4 Replies)
Discussion started by: shellscripter
4 Replies
5. Shell Programming and Scripting
Greetings, using ksh on Solaris, I am trying to identify the current version of a package installed on multiple servers using if statement in a precursor to upgrading.
I have searched the forums and have found many hits, reviewed 3 pages and have tried the different variations noted there. Also... (3 Replies)
Discussion started by: 22blaze
3 Replies
6. Shell Programming and Scripting
hi all, i am using the below command in my script
if ; then
This statement is causing the problme "ScriptName.ksh: XXX-XXX: unknown test operator"
could you please suggest me , how can i avoid these messages.
Singhal (7 Replies)
Discussion started by: singhald
7 Replies
7. Shell Programming and Scripting
In my script (currently running on Solaris ) I'm testing for zero size with wild character. There are mutilple files exist in the directory.
if
then
filename=`ls -1tr ${fileformat}.${date}.? | tail -1`
else
${BATCH_FATAL:-echo} "$0:ERROR:No file found ${source}/${fileformat}.${date}.?"... (5 Replies)
Discussion started by: gauravgoel83
5 Replies
8. Shell Programming and Scripting
Hi ,
Os - Solaris
Shell - Ksh
I am getting below error in if condition
+ id
+
./om_wf_complete.sh: gid=4081(Infadmn): unknown test operator
+ exit 1
if ; then
touch /home/odwt/1.0.0/out/oworkflow.dat
chmod 777 /home/odwt/1.0.0/out/oworkflow.dat
elif ; then
touch... (8 Replies)
Discussion started by: nag_sathi
8 Replies
9. Shell Programming and Scripting
O/S solaris 9
shell ksh
if
then
chk_op="WARNING...reboot within the last 24hrs, restarted at `who -r | awk '{print $4$5"@"$6}'`" ;
else
if ;
then
last_reboot1=`who -b | awk '{print $4" "$5" "$6}'`
last_reboot2='..OK..'`uptime | awk '{print$3" "$4}'`
... (4 Replies)
Discussion started by: squrcles
4 Replies
10. Shell Programming and Scripting
Hi,
I wrote a function for the first time and not able to get the desired result.
I have requirement to execute 10 queries. For this i wrote a function like below.
function Command {
typeset var SOL;
if ; then CONNECTION="${CONNECTION} -e -time";
else SOL="`nzsql ${CONNECTION} -c... (8 Replies)
Discussion started by: Samah
8 Replies
LEARN ABOUT MOJAVE
jrunscript
jrunscript(1) General Commands Manual jrunscript(1)
NAME
jrunscript - command line script shell
SYNOPSIS
jrunscript [ options ] [ arguments... ]
PARAMETERS
options
Options, if used, should follow immediately after the command name.
arguments
Arguments, if used, should follow immediately after options or command name.
DESCRIPTION
jrunscript is a command line script shell. jrunscript supports both an interactive (read-eval-print) mode and a batch (-f option) mode of
script execution. This is a scripting language independent shell. By default, JavaScript is the language used, but the -l option can be
used to specify a different language. Through Java to scripting language communication, jrunscript supports "exploratory programming"
style.
NOTE: This tool is experimental and may not be available in future versions of the JDK.
OPTIONS
-classpath path
Specify where to find the user's .class files that are accessed by the script.
-cp path
This is a synonym for -classpath path
-Dname=value
Set a Java system property.
-Jflag
Pass flag directly to the Java virtual machine on which jrunscript is run.
-l language
Use the specified scripting language. By default, JavaScript is used. Note that to use other scripting languages, you also need to spec-
ify the corresponding script engine's jar file using -cp or -classpath option.
-e script
Evaluate the given script. This option can be used to run "one liner" scripts specified completely on the command line.
-encoding encoding
Specify the character encoding used while reading script files.
-f script-file
Evaluate the given script file (batch mode).
-f -
Read and evaluate a script from standard input (interactive mode).
-help
Output help message and exit.
-?
Output help message and exit.
-q
List all script engines available and exit.
ARGUMENTS
If [arguments...] are present and if no -e or -f option is used, then the first argument is the script file and the rest of the arguments,
if any, are passed as script arguments. If [arguments..] and -e or -f option are used, then all [arguments..] are passed as script argu-
ments. If [arguments..], -e and -f are missing, interactive mode is used. Script arguments are available to a script in an engine variable
named "arguments" of type String array.
EXAMPLES
Executing inline scripts
jrunscript -e "print('hello world')"
jrunscript -e "cat('http://java.sun.com')"
Use specified language and evaluate given script file
jrunscript -l js -f test.js
Interactive mode
jrunscript
js>print('hello world');
hello world
js>34 + 55
89
js> thread(function() { print('hello world'); }
hello world
js>
Run script file with script arguments
jrunscript test.js arg1 arg2 arg3
test.js is script file to execute and arg1, arg2 and arg3 are passed to script as script arguments. Script can access these using "argu-
ments" array.
SEE ALSO
If JavaScript is used, then before evaluating any user defined script, jrunscript initializes certain built-in functions and objects. These
JavaScript built-ins are documented in jsdocs.
06 Aug 2006 jrunscript(1)