I am able to print the results out but i need to like use the values (the output value) and set each data with a variable sth like
a = ${array[1]}
but i know this wont work.
i am not sure how should i read a file and get the data inside, so that when i read this file it set all the vales to the correct place and run the script.
i have these values inside variable $blah
BUNGA TERATAI 3 5055 ITH 1 0 0 0 1 1
JADE TRADER 143W ITH 4 0 0 0 4 4
MOL SPLENDOR 0307A ITH 3 0 0 0 3 3
so how do I split them into array with the... (4 Replies)
I have a array as
CArray=( a1 a2 )
and a1,a2,a3 are also array as:
a1=(1 2 3)
a2=(3 4 5)
now I have this in my code:
for i in `echo "${CArray}"`
do
echo ${$i}
done
It is giving error as :"bad substitution"
It should give me value as
1 2 3
3 4 5
how can I get this...Can u please... (2 Replies)
I wnat to assign a set of values to a variable
and
use it in if condition.
for example:
i=$1
d=1 2 3 4 5 6
if
then
echo "Fine"
else
echo "Check"
fi
i will either of the value in d, i.e. i can be 1 or 2 or any value in d, How this can be done?
Thanks in advance (2 Replies)
I have an two arrays. One array BINDIST consists of fences. I have another array XOFFS.
Eg
BINDIST = 0 10 20 30 40 50 60
XOFFS = 2 3 4 23 25 28 55 58
I want to find to find the indices of values in XOFFS that are closest to each BINDIST.
My idea is to do as follows
I create array... (7 Replies)
Dear All,
I have been trying to do a simple task of extracting 2 fields from the file (3 rows) and store it in an array variable. I tried with:
#! /bin/bash
ch=`cut -f10 tmp.txt`
counter=0
for p in $pid
do
c=${ch}
echo "$c ..$counter"
counter=$((counter+1))... (2 Replies)
Am using a find command in my script .The output may be one or more. I need to store those values in a array and need to access those. Am unable to find the solution . Any help on this will be helpful.
if
< code>
else a=<find command output which gives the file name either 1 or more>
if 1... (1 Reply)
Hi All,
Need a help. I am just learning Shell scripting. Need a requirement like to attach variable to array values. Value of from is AF and to is AD.
froml=$(echo $from | tr '' '')
tol=$(echo $to | tr '' '')
Schemas=(AWQM WFCONTROLLER PROVCO PRISM)
for s in "${Schemas}"
do
... (3 Replies)
Can some one please help me with the syntax in shell script for the below :
if $var1 exists in ('val1','val2','val3')
I want to execute a set of commands if the value of var1 variable matches any one of the given string values. Please let me know if there are any other option to go by.
... (10 Replies)
while i've used arrays to work with variables, i've never used them to loop through a set of strings and wanted to ask the community for some feedback or assistance.
let me be specific. here's my code:
# URL port Variables
port2195=`nc -z $url2195 2195`
port2196=`nc -z $url2196 2196`... (5 Replies)
Discussion started by: hungryd
5 Replies
LEARN ABOUT HPUX
secure_sid_scripts
secure_sid_scripts(5) File Formats Manual secure_sid_scripts(5)NAME
secure_sid_scripts - controls whether setuid and setgid bits on scripts are honored
VALUES
Failsafe
Default
Allowed values
Recommended values
DESCRIPTION
This tunable controls whether and bits on executable scripts have any effect. Honoring on scripts make a system vulnerable to attack by
malicious users.
The default value for this variable is 1, indicating that bits are to be ignored by the execve(2) system call for higher security. The
tunable can be set to 0 for a compatibility with older releases at the expense of security. Hewlett-Packard strongly recommends that you
not change the value of this tunable unless there is an urgent need to do so.
When a script with bits is executed, the kernel generates the following error message to both the terminal controlling and the system log.
(To view the error message, use dmesg(1M) or inspect
Who is Expected to Change This Tunable?
Administrator.
Restrictions on Changing
Changes to this tunable take effect for new scripts started after the change.
When Should the Value of This Tunable Be Changed?
This tunable controls operational modes rather than data structure sizes and limits. The appropriate setting for a system depends on
whether you consider security or compatibility to be most important.
A value of is compatible with previous releases of HP-UX, but it is also less secure.
A value of provides security against race condition attacks exploiting scripts.
What Are the Side Effects of Changing the Value
This tunable controls only executable scripts (not programs) with bit set. HP-UX does not ship with any such scripts. If the customer
wishes to use scripts, third party applications such as or can be used. Alternatively, the shell script can be wrapped in a simple C pro-
gram that runs the shell script with appropriate permissions:
What Other Tunable Values Should Be Changed at the Same Time?
None.
WARNINGS
None. All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future
releases of HP-UX.
Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation,
some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun-
able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was
factory installed on your system, see at
FILES AUTHOR
was developed by HP.
SEE ALSO chmod(1), execve(2), kctune(1M).
Tunable Kernel Parameters secure_sid_scripts(5)