10-06-2008
getting spaces while reading file from for loop
Hi ,
I am getting similar problem,
but in my case i am fetching variable value from a file , and then echo the value, but its considering spaces in the file. for exmp:
file - temp1 has contents in quotes
"group name used to communicate with x service"
"group name used to communicate with y service"
i used for loop :
for var in `cat "temp1"`
do
echo "DESC=$var;"
done
the desired output is
DESC="group name used to communicate with x service";
DESC="group name used to communicate with y service";
however, the output coming is
DESC="group";
DESC="name";
its reading spaces also...
Pls suggest...............
Thanks in advance
Aparna
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Please help me out in this... I am new to scripting
How to compare two strings by using the same string in single loop,
I am using ksh
for ex:see the code snippet below
I am writing in java,
Can u guys tell me that in scripting
if ("string1"=="string2" ||... (2 Replies)
Discussion started by: Anji
2 Replies
2. Shell Programming and Scripting
Hi,
I am trying to write a script which will read inputs form user and process those files, I have issue reading the input parameters in a loop. Following is the script...
I run the script as ./Script.sh 3 table1 table 2 table3
NumberOfTables=$1
let TableCount=1
while
do
... (3 Replies)
Discussion started by: mgirinath
3 Replies
3. Shell Programming and Scripting
hi, unix wizards,
i have a question about the logic of my inner for loop below. first, what i am trying to do is to write a script called create_account that automatically creates mysql accounts. the user can provide a user_name or a group_id as an argument (and the script can take multiple... (1 Reply)
Discussion started by: ankimo
1 Replies
4. Shell Programming and Scripting
Hello,
I've got next problem:
I want to examine at the beginning of a script in an if loop that:
1. Is there 4 parameters given
2. If first state is true then: is there switches -e and -d?
3. At the end, how can i indentify them as variebles regardlees to its order.
I was thinking like... (2 Replies)
Discussion started by: szittyafergeteg
2 Replies
5. Shell Programming and Scripting
Hi there
I'm new to UNIX scripting; I’m stuck with the following
I have an Oracle SQL script that takes three parameters
1- File Name
2- File Path
3- File creation date
Under UNIX I have a folder where files will be placed frequently and I need to upload those files to Oracle, what I need... (3 Replies)
Discussion started by: windjashi
3 Replies
6. Shell Programming and Scripting
Hi all,
Could someone please advise what is the correct syntax for my little script to process a table of values?
The table is as follows:
0.002432 20.827656
0.006432 23.120364
0.010432 25.914184
0.014432 20.442655
0.018432 20.015243
0.022432 21.579517
0.026432 18.886874... (9 Replies)
Discussion started by: euval
9 Replies
7. UNIX for Dummies Questions & Answers
#!/bin/bash
function check_num_args()
{
if ; then
echo "Please provide a file name"
else
treat_as_file $*
fi
}
function treat_as_file()
{
numFiles=$#
for((i=1;i<=$numFiles;i++));do
echo $i
... (3 Replies)
Discussion started by: kikilahooch
3 Replies
8. Shell Programming and Scripting
Hey guys,
How do I make a loop that reads all the parameters en then stop when there are no parameters anymore ?
Something that gives an output like this:
./Script.sh parameter1 parameter2 parameter3
parameter = parameter1
parameter = parameter2
parameter = parameter3
Thanks a lot,... (5 Replies)
Discussion started by: Miki1579
5 Replies
9. UNIX for Dummies Questions & Answers
hi guys, I have this question. I am creating an script to that read a text file(.ini) with the list of the patterns to find for example:
EPMS_VO
EMPS_PARTS
Then it check if file have been delivered in a folder and process it with each pattern, but I am having problems concatenting the... (7 Replies)
Discussion started by: Danman
7 Replies
10. Shell Programming and Scripting
I like to “optimize” / make more like a real program my bash script by replacing repetitious code which utilizes positional parameters.
I am having two issues I cannot solve and would appreciate some assistance with resolving them.
a) how to modify the whiptail checklist... (3 Replies)
Discussion started by: annacreek
3 Replies
LEARN ABOUT MOJAVE
smf_restarter
smf_restarter(5) Standards, Environments, and Macros smf_restarter(5)
NAME
smf_restarter - service management facility conventions for restarters
DESCRIPTION
All service instances in the service management facility must be managed by a restarter. This manual page describes configuration, func-
tionality, and reporting characteristics that are common to all restarters in the framework. Characteristics specific to a particular
restarter are described in the restarter's manpage.
For each managed service, a restarter relies on retrieving properties on the service instance to determine configuration. The restarter
manages a set of property groups to communicate the current disposition of a service with display tools such as svcs(1).
Service configuration
The common restarter configuration for all services is captured in the general property group. This group includes the following required
and optional property settings.
enabled This is a required property. If set, the restarter of an instance attempts to maintain availability of the service.
restarter This is an optional property that allows the specification of an alternate restarter to manage the service
instance. If the restarter property is empty or absent, the restarter defaults to svc.startd(1M).
single_instance This is an optional property. When set, only one instance of the service is allowed to transition to an online or
degraded status at any time.
transient_process This is an optional property. When specified, the service does not contain objects that run indefinitely
Service reporting
All restarters report status using the restarter property group, which includes the following properties:
next_state The current state and next state, if currently in transition, for instances stored in these properties. See smf(5)
for a description of the potential states.
auxiliary_state An astring with no spaces that contains a precise term to describe the full restarter-specific state in combination
with the restarter state property. The auxiliary state may not always be set and is always cleared during transi-
tion out of any state. Each restarter must define the precise list of auxiliary states it will use.
state_timestamp The time when the current state was reached.
contract The primary process contract ID, if any, under which the service instance is executing.
SEE ALSO
svcs(1), svc.startd(1M), service_bundle(4), smf(5), smf_method(5)
SunOS 5.10 08 Mar 2004 smf_restarter(5)