Sponsored Content
Top Forums Shell Programming and Scripting Getting value from one file and assigning it to variables of another file. Post 302547610 by angel12345 on Tuesday 16th of August 2011 07:12:52 AM
Old 08-16-2011
Getting value from one file and assigning it to variables of another file.

Hi,

I need to read two values,startdate and enddate from a param file and then write this value to another param file(global) under a specific workflow name.Here in global param file there is may workflow names, hence we need to check for the right one and then add the data below it.

Any pointers would be really helpful.
Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

assigning variables

Before I even attempt this, is it possible to grep for a pattern, maybe a partial sentence like "go to page 3", assign that to a variable and then use awk or something to pull out the 3 and assign it to a variable? So first I would have Gotopg = "go to page 3" then page = 3 (9 Replies)
Discussion started by: k@ssidy
9 Replies

2. Shell Programming and Scripting

Assigning file attributes to variables

Hi, I'm trying to assign the permissions, owner and group of a file to seperate variables, but using ls -l filename | awk '{print $1 "\t" $3 "\t" $4}' gives the owner as tom.ja instead of tom.james Is there any way to expand it so i get the full name, or is there an easier way to get them... (5 Replies)
Discussion started by: olimiles
5 Replies

3. UNIX for Dummies Questions & Answers

Assigning variables using awk

Hi, I am having a line which is separated by - I need to extract each field and put into some variable. a=`echo "this-is-the-case" | awk -F- '{print $1}' ` b=`echo "this-is-the-case" | awk -F- '{print $2}' ` c=`echo "this-is-the-case" | awk -F- '{print $3}' ` d=`echo "this-is-the-case" | awk... (2 Replies)
Discussion started by: posix
2 Replies

4. UNIX for Dummies Questions & Answers

File Field Replacement, Assigning Fields to Variables, Lists/Arrays?

Okay, I've made threads on extracting fields and comparing strings in separate files in .csv's. I've written the following code with intentions of learning more. I just want this one question answered: How can I assign fields from a file(comma separated) to variables? My goal is to check... (0 Replies)
Discussion started by: chickeneaterguy
0 Replies

5. Shell Programming and Scripting

Perl Help - Assigning variables to text file contents

I am looking to create a perl script which will take numbers from a simple text file, convert them from decimal to hex, and then rewrite those values in the file or create a new file with the hex numbers(whichever's easier). My text document for example would be something as simple as 1312... (6 Replies)
Discussion started by: samh785
6 Replies

6. Shell Programming and Scripting

Help in assigning values to variables from the file

Hi! This might be a simple thing, but I'm struggling to assign values to variables from the file. I've the following values stored in the file.. It consists of only two rows.. 10 20 I want to assign the first row value to variable "n1" and the second row value to variable "n2".. That is ... (3 Replies)
Discussion started by: abk07
3 Replies

7. Shell Programming and Scripting

Bash: Reading a file and assigning variables from file

I have a file that has four values on each line and I'd like to give each column a variable name and then use those values in each step of a loop. In bash, I believe you could use a while loop to do this or possibly a cat command, but I am super new to programming and I'm having trouble decoding... (2 Replies)
Discussion started by: ccorder22
2 Replies

8. Shell Programming and Scripting

Assigning variables

i have variables RECIPIENTS_DEVL,RECIPIENTS_UACC,RECIPIENTS_PROD i have a case statement to get the phase variable: case ${WMD_UPHASE1} in u) WMD_UPHASE4=UACC;; i) WMD_UPHASE4=DEVL;; p) WMD_UPHASE4=PROD;; d) WMD_UPHASE4=DEVL;; *) WMD_UPHASE4=DEVL;; esac I am unable to... (3 Replies)
Discussion started by: Arun Mishra
3 Replies

9. Shell Programming and Scripting

Assigning Variables

Hi, Can the below be clarified please. i just want to know what is the difference between the two ways of assigning variables as mentioned below. export SRC_TBL=${SRC_TBL-"MMA_COPAY_PLN_FACT_STG"} export SRC_TBL="MMA_COPAY_PLN_FACT_STG" thanks in advance :) Arun (1 Reply)
Discussion started by: Arun Mishra
1 Replies

10. Shell Programming and Scripting

Searching a file - and assigning responses to variables (or something)

So first: Sorry if the title is confusing... I have a script I'm writing with a file with several names in it (some other info - but it's not really pertinent...) - I want to be allow the user to delete certain records, but I ran into a problem I'm not sure how to go about fixing. If I were... (6 Replies)
Discussion started by: sabster
6 Replies
Param(3pm)						User Contributed Perl Documentation						Param(3pm)

NAME
APR::Request::Param - wrapper for libapreq2's param API. SYNOPSIS
use APR::Request::Param; $arg1 = $req->args('alpha'); $body = $req->body; $body->param_class("APR::Request::Param"); ok $_->isa("APR::Request::Param") for values %$body; @uploads = grep {$_->upload} values %$body; $param = $body->get('beta'); $param->upload_slurp(my $content); DESCRIPTION
The "APR::Request::Param" module provides base methods for interfacing with libapreq2's param API. It also provides a few utility functions and constants. This manpage documents version 2.13 of the APR::Request::Param, APR::Request::Brigade, and APR::Request::Brigade::IO packages. OVERLOADS
APR::Request::Param "" "$param" The double-quote interpolation operator maps to "APR::Request::Param::value()". METHODS
APR::Request::Param name $param->name() Returns the param's name. This attribute cannot be modified. value $param->value() Returns the param's value. This attribute cannot be modified. is_tainted $param->is_tainted() $param->is_tainted($set) Get/set the param's internal tainted flag. Note: if the param's charset is APREQ_CHARSET_UTF8(8), this also activates the SvUTF8_on flag during calls to name() and/or value(). $tainted = $param->is_tainted; $param->is_tainted(0); ok $param->is_tainted == 0; charset $param->charset() $param->charset($set) Get/set the param's internal charset. The charset is a number between 0 and 255; the current recognized values are 0 APREQ_CHARSET_ASCII (7-bit us-ascii) 1 APREQ_CHARSET_LATIN1 (8-bit iso-8859-1) 2 APREQ_CHARSET_CP1252 (8-bit Windows-1252) 8 APREQ_CHARSET_UTF8 (utf8 encoded Unicode) See is_tainted above for info about how APREQ_CHARSET_UTF8 relates to perl's UTF-8 flag. $charset = $param->charset; $param->charset(2); ok $param->charset == 2; make APR::Request::Param->make($pool, $name, $value) Fast XS param constructor. info $param->info() $param->info($set) Get/set the APR::Table headers for this param. upload $param->upload() $param->upload($set) Get/set the APR::Brigade file-upload content for this param. upload_filename $param->upload_filename() Returns the client-side filename associated with this param. upload_link $param->upload_link($path) Links the file-upload content with the local file named $path. Creates a hard-link if the spoolfile's (see upload_tempname) temporary directory is on the same device as $path; otherwise this writes a copy. upload_slurp $param->upload_slurp($data) Reads the entire file-upload content into $data. upload_size $param->upload_size() Returns the size of the param's file-upload content. upload_type $param->upload_type() Returns the MIME-type of the param's file-upload content. upload_tempname $param->upload_tempname() Returns the name of the local spoolfile for this param. upload_io $param->upload_io() Returns an APR::Request::Brigade::IO object, which can be treated as a non-seekable IO stream. upload_fh $param->upload_fh() Returns a seekable filehandle representing the file-upload content. METHODS
APR::Request::Brigade This class is derived from APR::Brigade, providing additional methods for TIEHANDLE, READ and READLINE. To be memory efficient, these methods delete buckets from the brigade as soon as their data is actually read, so you cannot "seek" on handles tied to this class. Such handles have semantics similar to that of a read-only socket. new, TIEHANDLE APR::Request::Brigade->TIEHANDLE($bb) Creates a copy of the bucket brigade represented by $bb, and blesses that copy into the APR::Request::Brigade class. This provides syntactic sugar for using perl's builtin "read", "readline", and "<>" operations on handles tied to this package: use Symbol; $fh = gensym; tie *$fh, "APR::Request::Brigade", $bb; print while <$fh>; READ $bb->READ($contents) $bb->READ($contents, $length) $bb->READ($contents, $length, $offset) Reads data from the brigade $bb into $contents. When omitted $length defaults to "-1", which reads the first bucket into $contents. A positive $length will read in $length bytes, or the remainder of the brigade, whichever is greater. $offset represents the index in $context to read the new data. READLINE $bb->READLINE() Returns the first line of data from the bride. Lines are terminated by linefeeds (the '12' character), but we may eventually use $/ instead. METHODS
APR::Request::Brigade::IO read OO interface to APR::Request::Brigade::READ. readline OO interface to APR::Request::Brigade::READLINE. SEE ALSO
APR::Request, APR::Table, APR::Brigade. COPYRIGHT
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. perl v5.10.1 2011-02-28 Param(3pm)
All times are GMT -4. The time now is 06:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy