Sponsored Content
Full Discussion: combine variables in one
Top Forums Shell Programming and Scripting combine variables in one Post 302338737 by vidyadhar85 on Tuesday 28th of July 2009 07:01:42 PM
Old 07-28-2009
to store some command o/p in a variable you have to put that command between backsticks "`"
for example
Code:
key1=`echo $line | awk -F\| '{ print $1 }'`

 

10 More Discussions You Might Find Interesting

1. Programming

How to convert byteArray variables to HexaString variables for Linux?

Hello everybody, I am having problem in converting byte array variables to Hexa String variables for Linux. I have done, converting byte array variables to Hexa String variables for Windows but same function doesn't work for linux. Is there any difference in OS ? The code for Windows is given... (2 Replies)
Discussion started by: ritesh_163
2 Replies

2. Shell Programming and Scripting

awk : combine 3 variables into 1

Within one of my awk scripts, I have three variables extracted and calculated on. When done, I simply want to combine the three. The following works, but looks weird. My script reads a field that has text and numbers, knowing the last four comprise MMYY (month and year) # YY are last two... (2 Replies)
Discussion started by: joeyg
2 Replies

3. Shell Programming and Scripting

combine

Hi I am having text file like this 001|ramu|hno221|>< sheshadripuram|delhi|560061>< 002|krishna|hno225|>< newdelhimain|delhi|560061>< i want to combine every two lines as single...line... i.e 001|ramu|hno221|sheshadripuram|delhi|560061 can u pls help me (3 Replies)
Discussion started by: suryanarayana
3 Replies

4. Shell Programming and Scripting

combine

Dear all i am having text file like xxx|yyy|1|2| zzz|rrr|3|4| www|xxx|>< 5|6|>< jjj|kkk|>< 8|9>< i want to join two lines which are having ' >< ' by taking only two lines at a stretch ...using awk command the result output should be xxx|yyy|1|2| zzz|rrr|3|4| www|xxx|5|6|... (2 Replies)
Discussion started by: suryanarayana
2 Replies

5. Shell Programming and Scripting

guide needed to combine 2 variables

readNOW=$(date +"%Y%m%d%H%M") read readTerminal #input B terminalc=$readTerminal echo eqpt_list_QC_$terminalcT_$readNOW how to get display result it: eqpt_list_QC_BT_201209121530 (2 Replies)
Discussion started by: ment0smintz
2 Replies

6. Shell Programming and Scripting

Running a script with multiple variables like 25 variables.

Hi All, i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way?? #!/bin/ksh ##script is sample.ksh age=$1 gender=$2 class=$3 . . .... (3 Replies)
Discussion started by: Lakshman_Gupta
3 Replies

7. Shell Programming and Scripting

BASH arrays and variables of variables in C++

Sometimes it is handy to protect long scripts in C++. The following syntax works fine for simple commands: #define SHELLSCRIPT1 "\ #/bin/bash \n\ echo \"hello\" \n\ " int main () { cout <<system(SHELLSCRIPT1); return 0; } Unfortunately for there are problems for: 1d arrays:... (10 Replies)
Discussion started by: frad
10 Replies

8. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies

9. UNIX for Dummies Questions & Answers

Combine two lists of variables

Thanks in advance for any advice and help. I have two lists of variables that I want to put into nested for loops. for x in 1 2 3 do for y in a b c do The output I want is: filepath/1/ command modified by a filepath/2/ command modified by b filepath/3/ command modified by c To... (10 Replies)
Discussion started by: wheyhamp
10 Replies

10. UNIX for Dummies Questions & Answers

How to pass variables into anothother variables?

Below are three variables, which I want to pass into variable RESULT1 username1=userid poihostname1=dellsys.com port1=8080 How can I pass these variables into below code... RESULT1=$((ssh -n username1@poihostname1 time /usr/sfw/bin/wget --user=sam --password=123 -O /dev/null -q... (4 Replies)
Discussion started by: manohar2013
4 Replies
rc.config(4)						     Kernel Interfaces Manual						      rc.config(4)

NAME
rc.config, rc.config.d - files containing system configuration information SYNOPSIS
DESCRIPTION
The system configuration used at startup is contained in files within the directory The file sources all of the files within and and exports their contents to the environment. /etc/rc.config The file is a script that sources all of the scripts, and also sources To read the configuration definitions, only this file need be sourced. This file is sourced by whenever it is run, such as when the command is run to transition between run states. Each file that exists in is sourced, without regard to which startup scripts are to be executed. /etc/rc.config.d The configuration information is structured as a directory of files, rather than as a single file containing the same information. This allows developers to create and manage their own configuration files here, without the complications of shared ownership and access of a common file. /etc/rc.config.d/* Files This is where files containing configuration variable assignments are located. Configuration scripts must be written to be read by the POSIX shell, and not the Bourne shell, or In some cases, these files must also be read and possibly modified by control scripts or the sam program. See sd(4) and sam(1M). For this reason, each variable definition must appear on a separate line, with the syntax: No trailing comments may appear on a variable definition line. Comment statements must be on separate lines, with the comment character in column one. This example shows the required syntax for configuration files: Configuration variables may be declared as array parameters when describing multiple instances of the variable configuration. For example, a system may contain two network interfaces, each having a unique IP address and subnet mask (see ifconfig(1M)). An example of such a dec- laration is as follows: Note that there must be no requirements on the order of the files sourced. This means configuration files must not refer to variables defined in other configuration files, since there is no guarantee that the variable being referenced is currently defined. There is no protection against environment variable namespace collision in these configuration files. Programmers must take care to avoid such prob- lems. /etc/TIMEZONE The file contains the definition of the environment variable. This file is required by POSIX. It is sourced by at the same time the files are sourced. SEE ALSO
rc(1M). rc.config(4)
All times are GMT -4. The time now is 01:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy