Sponsored Content
Top Forums Shell Programming and Scripting Assign Unknown Values to Variables Post 302927028 by sea on Saturday 29th of November 2014 10:52:16 PM
Old 11-29-2014
Best thing i could think of would be either an array, or using the var-value as filename within a tempfolder.

What are you heading for?
Might help to provide suggestions.
 

10 More Discussions You Might Find Interesting

1. Programming

how do u assign the values to different variables when it is presneted in one line??

hey people.. i have a configuration file that looks like 7080 7988 net04.xxxxx.edu 20 where 20 is the number of threads in the thread pool initially. net04.xxxxx.edu is the hostname. and 7080 7988 are two ports. first one for client requests and second one for dns communication. now my... (2 Replies)
Discussion started by: SwetaShah
2 Replies

2. Shell Programming and Scripting

How do I assign values to variables made in a script?

How do I assign values to variables made in a script? e.g. for ((x=0;x<=5;i+=1)); do Xm$i=$var done (0 Replies)
Discussion started by: gelitini
0 Replies

3. Shell Programming and Scripting

how can i read text file and assign its values to variables using shell

Hello, I have a cat.dat file, i would like shell to read each 3 lines and set this 3 lines to 3 different variables. my cat.dat is: 11 12 +380486461001 12 13 +380486461002 13 14 +380486461003 i want shell to make a loop and assign 1st line to student_id, 2nd line to... (4 Replies)
Discussion started by: rosalinda
4 Replies

4. Shell Programming and Scripting

Assign Values to variables from a text file

The text file has one single row and looks like this Q1 P1 2006 I have to pick up this values from a shell script into three different variables, say quarter, period and year from the above text file. Some one know's how to do this? I went through 'sed', dint really know how to... (3 Replies)
Discussion started by: sarsani
3 Replies

5. Shell Programming and Scripting

Assign values to variables of a file

Hi, I have a file like the following... CUST= DIR= NULIST= name=philps_123 How can i add values to each of these unassigned variables using a shell script? say for eg: i have values for CUST as onida, dir as /dir/onida, NULIST as /tmp/onida_files. How can i add these values to... (11 Replies)
Discussion started by: Tuxidow
11 Replies

6. Shell Programming and Scripting

Need to parse lines in a file into two words and assign the values to two variables

For example, I have a file with below lines containing VOB tags and VOB paths. * /vobs/fts/FTSUSM20_VOB /ccvobsslx01/projects/vobs/eml/FTSUSM20_VOB * /vobs/fts/FTS20_VOB /ccvobsslx01/projects/vobs/eml/FTS20_VOB * /vobs/pmv/PMS_VOB /ccvobsslx01/projects/vobs/cpm/_/PMS_VOB *... (4 Replies)
Discussion started by: senthilkc
4 Replies

7. Shell Programming and Scripting

Read variables names from array and assign the values

Hi, I have requirement to assign values to variables which are created dynamically. Below is the code which i am using to achieve above requirement. #!/bin/ksh oIFS="$IFS"; IFS=',' STR_FAIL_PARENT_IF_FAILS="WF_F_P_IF_FAILS1,WF_F_P_IF_FAILS2,WF_F_P_IF_FAILS3" set -A... (1 Reply)
Discussion started by: tmalik79
1 Replies

8. Shell Programming and Scripting

Unable to read assign values to two variables in while loop

I am trying to read a input file which has two columns separated by space Input file server1 server2 server3 server4 server5 server6 When i execute the below while code it reads line by line and a and b variables are able to successfully fetch the values while read a b do echo "$a" echo... (5 Replies)
Discussion started by: chidori
5 Replies

9. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

10. Shell Programming and Scripting

A better way to assign values to variables - shell

so i've been used to doing it this way: SVAL=$(echo "7 3 2 38 3" | awk '{print $2}') 4VAL=$(echo "4:21:N:3" | awk -F":" '{print $4}') I know there's a way to do it by putting the value in an array and assigning it that way. but i'm not sure how to do it efficiently. any ideas? i dont... (9 Replies)
Discussion started by: SkySmart
9 Replies
Pod::Abstract::BuildNode(3pm)				User Contributed Perl Documentation			     Pod::Abstract::BuildNode(3pm)

NAME
Pod::Abstract::BuildNode - Build new nodes for use in Pod::Abstract. SYNOPSIS
use Pod::Abstract::BuildNode qw(node nodes); # shorthand my $root_doc = node->root; for(my $i = 1; $i < 10; $i ++) { $root_doc->push(node->head1("Heading number $i")); } print $root_doc->pod; DESCRIPTION
For building a new Pod::Abstract document, or adding nodes to an existing one. This provides easy methods to generate correctly set nodes for most common Pod::Abstract elements. NOTES
Pod::Abstract::BuildNode can export two functions, "node" and "nodes". These are constant functions to provide a shorthand so instead of writing: use Pod::Abstract::BuildNode; # ... my @nodes = Pod::Abstract::BuildNode->from_pod( $pod ); You can instead write: use Pod::Abstract::BuildNode qw(node nodes); # ... my @nodes = nodes->from_pod($pod); Which is more readable, and less typing. "node" and "nodes" are both synonyms of "Pod::Abstract::BuildNode". This shorthand form is shown in all the method examples below. All methods operate on the class. METHODS
from_pod my @nodes = nodes->from_pod($pod_text); Given some literal Pod text, generate a full subtree of nodes. The returned array is all of the top level nodes. The full document tree will be populated under the returned nodes. root my $root = node->root; Generate a root node. A root node generates no output, and is used to hold a document tree. Use this to make a new document. begin my $begin_block = node->begin($command); Generates a begin/end block. Nodes nested inside the begin node will appear between the begin/end. Note that there is no corresponding "end" method - the end command belongs to it's corresponding begin. for my $for = node->for('overlay from <class>'); Create a =for node. The argument is the literal body of the for node, no parsing will be performed. paragraph my $para = node->paragraph('Pod text'); Generates a Pod paragraph, possibly containing interior sequences. The argument will be parsed as Pod, and will generate text and sequence nodes inside the paragraph. verbatim my $v = node->verbatim($text); Add the given text as a verbatim node to the document. All lines in the fiven $text will be indented by one space to ensure they are treated as verbatim. heading my $head2 = node->heading(2, $heading); Generate a heading node at the given level. Nodes that "belong" in the heading's section should be nested in the heading node. The $heading text will be parsed for interior sequences. head1 node->head1($heading); head2 node->head2($heading); head3 node->head3($heading); head4 node->head4($heading); over my $list = node->over([$num]); Generates an over/back block, to contain list items. The optional parameter $num specifies the number of spaces to indent by. Note that the back node is part of the over, there is no separate back method. item my $item = node->item('*'); Generates an item with the specified label. To fill in the text of the item, nest paragraphs into the item. Items should be contained in over nodes. text my $text = node->text('Literal text'); Generates a literal text node. You generally do not want this, you probably want a paragraph. Use this if you want to, for example, append a word at the end of a paragraph. pod my $n = node->pod; Generates an "=pod" command. Can be useful to force pod mode at the end of cut nodes. Do not confuse with "from_pod"! my $cut = node->cut; Generates an explicit "=cut" command. AUTHOR
Ben Lilburne <bnej@mac.com> COPYRIGHT AND LICENSE
Copyright (C) 2009 Ben Lilburne This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-01-03 Pod::Abstract::BuildNode(3pm)
All times are GMT -4. The time now is 05:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy