Hello
You know how to ask for the existence of one parameter and depending about it then do something, example:
Original script:
###################
USER=$1
PASS=$2
program1 $USER $PASS
###################
Desired shell
###################
USER=$1
PASS=$2
ARCH=$3
if
then
... (3 Replies)
Hi folks,
I'm trying to concatinate a time zone offset parameter to the word "GMT" and i failed.
I have the following function:
update_opmn_xml()
{
echo "\nChecking opmn.xml ..."
## Calculating timezone offset
calc_timezone_offset
echo ${TzOffset}
export opmnXml=/tmp/opmn.xml... (1 Reply)
I am trying to get the value of the user id (uid), which is the shell parameter.Then, read the /etc/passwd and keep the lines where the uid is superior to the parameter and write this line in a new file. But I am not getting what I wanted. Perhaps there is a problem with the Syntax below :-
... (1 Reply)
Hi,
I am new to unix and using linux 7.2. I would like to create a script that would make it easyer for me to run my java programms. At the moment I have to type java myJavaprogram
I am trying to write a script that will allow me to type something like this "myscript myJavaprogram" or maybe... (4 Replies)
Hi,
I am having list of C function names say
function1
function2
function3
and i am having many source files under my current directory.
Now i would like to find the file names which contains the function definition from my list.
It would be appreciable if... (1 Reply)
How can i chnage the parameter value in shell script.
file name is icare_mmi_cls.com, inside that the parameter name is 10.100.1.2" replace the address to bep-sftp.cce.com.
can you please provide me with examples.
Thanks
Double post - check your PMs and follow the rules, thanks. (0 Replies)
How can i chnage the parameter value in shell script.
file name is icare_mmi_cls.com, iside that the parameter name is 10.100.1.2" replace the address to bep-sftp.cce.com.
can you please provide me with examples.
Thanks. (3 Replies)
Hi
I have two shell script, the second script takes as a parameter the output variable of the first script, please how to retrieve the variable from the first script to pass as a parameter to the second script?
Script1.sh
i=0
i=$(($i + 1))
Script2.sh
echo $1
Thank you (0 Replies)
Good afternoon, i need your help pls
I want to write a new script that start running as soon as a previus one finish via Autosys (it should be implemented via Autosys too to validate the exsitance and the successful transfered file to a remote server
Whenever the file arrives to the path... (2 Replies)
How can I get Parameters with Shell Request.
I mean so but not work:
PHP:
error_reporting(E_ALL);
$hallo ="Hallo Welt";
print_r(shell_exec("sh client.sh $hallo"));
Shell:
echo $hallo
echo ceck (5 Replies)
Discussion started by: Linuxmann
5 Replies
LEARN ABOUT SUNOS
test
test(1F) FMLI Commands test(1F)NAME
test - condition evaluation command
SYNOPSIS
test expression
expression
DESCRIPTION
test evaluates the expression expression and if its value is true, sets a 0 (TRUE) exit status; otherwise, a non-zero (FALSE) exit status
is set; test also sets a non-zero exit status if there are no arguments. When permissions are tested, the effective user ID of the process
is used.
All operators, flags, and brackets (brackets used as shown in the second SYNOPSIS line) must be separate arguments to test. Normally these
items are separated by spaces.
USAGE
Primitives
The following primitives are used to construct expression:
-r filename True if filename exists and is readable.
-w filename True if filename exists and is writable.
-x filename True if filename exists and is executable.
-f filename True if filename exists and is a regular file.
-d filename True if filename exists and is a directory.
-c filename True if filename exists and is a character special file.
-b filename True if filename exists and is a block special file.
-p filename True if filename exists and is a named pipe (FIFO).
-u filename True if filename exists and its set-user-ID bit is set.
-g filename True if filename exists and its set-group-ID bit is set.
-k filename True if filename exists and its sticky bit is set.
-s filename True if filename exists and has a size greater than 0.
-t[fildes] True if the open file whose file descriptor number is fildes (1 by default) is associated with a terminal
device.
-z s1 True if the length of string s1 is 0.
-n s1 True if the length of the string s1 is non-zero.
s1 = s2 True if strings s1 and s2 are identical.
s1 != s2 True if strings s1 and s2 are not identical.
s1 True if s1 is not the null string.
n1 -eq n2 True if the integers n1 and n2 are algebraically equal. Any of the comparisons -ne, -gt, -ge, -lt, and -le
may be used in place of -eq.
Operators
These primaries may be combined with the following operators:
! Unary negation operator.
-a Binary and operator.
-o Binary or operator (-a has higher precedence than -o).
`(expression)` Parentheses for grouping. Notice also that parentheses are meaningful to the shell and, therefore,
must be quoted.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO find(1), sh(1), attributes(5)NOTES
If you test a file you own (the -r , -w , or -x tests), but the permission tested does not have the owner bit set, a non-zero (false) exit
status will be returned even though the file may have the group or other bit set for that permission. The correct exit status will be set
if you are super-user.
The = and != operators have a higher precedence than the -r through -n operators, and = and != always expect arguments; therefore, = and !=
cannot be used with the -r through -n operators.
If more than one argument follows the -r through -n operators, only the first argument is examined; the others are ignored, unless a -a or
a -o is the second argument.
SunOS 5.10 5 Jul 1990 test(1F)