Sponsored Content
Top Forums Shell Programming and Scripting Assign values to variables of a file Post 302385487 by Amit.Sagpariya on Friday 8th of January 2010 08:16:27 AM
Old 01-08-2010
No tell me one thing... from where u will get list of user? Is it in a file or you need to pass dynamically each time...

For each use, do u need to create seperate file like above. If yes, what will be the output file name conventions?
 

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

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

6. 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

7. Shell Programming and Scripting

Read record from the text file & assign those values to variables in the script

For eg: I have sample.txt file with 4 rows of record like: user1|password1 user2|password2 user3|password3 user4|password4 The username and password is sepsrated by '|' I want to get the 1st row value from the file and assign it to two different variables(username and password) in my... (1 Reply)
Discussion started by: priya001
1 Replies

8. 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

9. 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

10. Shell Programming and Scripting

Assign Unknown Values to Variables

i have a program that spits out a certain number of values. i dont know the number of values. they can be 4, 10, 7, 20, no idea. but, i want to be able to assign each of the value returned by this program to a variable. in the latest instance, the program gave the following 6 values: 4... (8 Replies)
Discussion started by: SkySmart
8 Replies
Class::Mix(3pm) 					User Contributed Perl Documentation					   Class::Mix(3pm)

NAME
Class::Mix - dynamic class mixing SYNOPSIS
use Class::Mix qw(mix_class); $foobar_object = mix_class("Foo", "Bar")->new; use Class::Mix qw(genpkg); $package = genpkg; $package = genpkg("Digest::Foo::"); DESCRIPTION
The "mix_class" function provided by this module dynamically generates `anonymous' classes with specified inheritance. FUNCTIONS
mix_class(CLASSES ...) This function is used to dynamically generate `anonymous' classes by mixing pre-existing classes. This is useful where an incomplete class requires use of a mixin in order to become instantiable, several suitable mixins are available, and it is desired to make the choice between mixins at runtime. The function takes as its argument list the desired @ISA list of the mixture class to be created; that is, a list of names of classes to inherit from. It generates a class with the specified inheritance, and returns its name. The same class will be returned by repeated invocations with the same class list. The returned name may be used to call a constructor or other class methods of the mixed class. A class name must be returned because there is no such thing as an anonymous class in Perl. Classes are referenced by name. The names that are generated by this function are unique and insignificant. See "genpkg" below for more information. If fewer than two classes to inherit from are specified, the function does not bother to generate a new class. If only one class is specified then that class is returned. If no classes are specified then "UNIVERSAL" is returned. This provides the desired inheritance without creating superfluous classes. This function relies on the classes it returns remaining unmodified in order to be returned by future invocations. If you want to modify your dynamically-generated `anonymous' classes, use "genpkg" (below). genpkg([PREFIX]) This function selects and returns a package name that has not been previously used. The name returned is an ordinary bareword-form package name, and can be used as the second argument to "bless" and in all other ways that package names are used. The package is initially empty. The package names returned by this function are of a type that should not be used as ordinary fixed module names. However, it is not possible to entirely prevent a clash. This function checks that the package name it is about to return has not already been used, and will avoid returning such names, but it cannot guarantee that a later-loaded module will not create a clash. PREFIX, if present, specifies where the resulting package will go. It must be either the empty string (to create a top-level package) or a bareword followed by "::" (to create a package under that name). For example, "Digest::" could be specified to ensure that the resulting package has a name starting with "Digest::", so that "Digest->new" will accept it as the name of a message digest algorithm. SEE ALSO
Class::Generate AUTHOR
Andrew Main (Zefram) <zefram@fysh.org> COPYRIGHT
Copyright (C) 2004, 2006, 2009 Andrew Main (Zefram) <zefram@fysh.org> LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2010-03-24 Class::Mix(3pm)
All times are GMT -4. The time now is 05:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy