Sponsored Content
Top Forums Shell Programming and Scripting How to read each line from input file, assign variables, and echo to output file? Post 302893357 by Scottie1954 on Tuesday 18th of March 2014 06:30:19 PM
Old 03-18-2014
Thanks, Jedi Master and Chubler_XL. Both answers worked.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk/shell question: Read from file and assign to variables.

Is anyone able to help with writing a program that will do the following: 1. Read the contents of a file, line by line, and on each line, assign each of the two columns to a shell variable. 2. perform an action on the variables 3. Read the next line. Here is what I've gotten so far. ... (3 Replies)
Discussion started by: akbar
3 Replies

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

3. Shell Programming and Scripting

How to read a file and assign variables to data?

Hi, I need a simple csh script to read a file containing data like this Buy Transactions : 175 Sell Transactions : 212 Server: sepo2 i want to read both field and its value and assign variables to each.. (2 Replies)
Discussion started by: pravsripad
2 Replies

4. Shell Programming and Scripting

Read file and for each line replace two variables, add strings and save output in another file

Hi All, I have a file, let's call it "info.tmp" that contains data like this .. ABC123456 PCX333445 BCD789833 I need to read "info.tmp" and for each line add strings in a way that the final output is put /logs/ua/dummy.trigger 'AAA00001.FTP.XXX.BLA03A01.xxxxxx(+1)' where XXX... (5 Replies)
Discussion started by: Andy_ARG
5 Replies

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

6. Shell Programming and Scripting

Read file from input and redirect to output file

Hi , i am having an file which contains 5 file_name data, i need to read the file name and will perform certain operation and generate out file names with named as 5 individual file_names for eg: file.txt contains file_name1.txt|hai file_name2.txt|bye file_name3.txt|how... (3 Replies)
Discussion started by: rohit_shinez
3 Replies

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

8. Shell Programming and Scripting

Do While Loop + Read From File + assign line to a variable

Hello, I am using below code for reading from a file and assigning the values to a variable , but it is loosing the value after the loop , please suggest to retain the value of the variable after the loop , while IFS=: read -r line do set $dsc=$line echo 'printing line variable ' $line... (1 Reply)
Discussion started by: ParthThakkar
1 Replies

9. Shell Programming and Scripting

ksh - Read input from file and output CSV i same row

Hello I have the following output and want the output to look: FROM: GigabitEthernet0/0 is up, line protocol is up 1 input errors, 0 CRC, 0 frame, 1 overrun, 0 ignored 275 output errors, 0 collisions, 3 interface resets GigabitEthernet0/1 is up, line protocol is up 0... (4 Replies)
Discussion started by: JayJay2018
4 Replies

10. UNIX for Beginners Questions & Answers

How To Read a File and Assign the line values to an Array?

i have this basic code that i wrote to read a file and place it's values to an array. the source/input file will have multiple strings on it that is separated by a whitespace. sample_list.txt file contents: ACCT1 TABLE1 ACCT2 TABLE2 ACCT3 TABLE3 script file: sample_list.sh ... (3 Replies)
Discussion started by: wtolentino
3 Replies
snmpdx(1M)						  System Administration Commands						snmpdx(1M)

NAME
snmpdx - Sun Solstice Enterprise Master Agent SYNOPSIS
/usr/lib/snmp/snmpdx [-hy] [-a filename] [-c config-dir] [-d debug-level] [-i filename] [-m GROUP -m SPLIT] [-o filename] [-p port] [-r filename] DESCRIPTION
The Master Agent, snmpdx, is the main component of Solstice Enterprise Agent (SEA) technology. It runs as a daemon process and listens to User Datagram Protocol (UDP) port 161 for SNMP requests. The Master Agent also opens another port to receive SNMP trap notifications from various subagents. These traps are forwarded to various managers, as determined by the configuration file. Upon invocation, snmpdx reads its various configuration files and takes appropriate actions by activating subagents, determining the sub- tree Object Identifier (OID) for various subagents, populating its own Management Information Bases (MIBs), and so forth. The Master Agent invokes subagents, registers subagents, sends requests to subagents, receives responses from subagents, and traps notifications from sub- agents. The Master Agent is invoked by the service management facility smf(5) at boot time if svc:/application/management/snmpdx is enabled (see NOTES) and contents of the resource configuration file /etc/snmp/conf/snmpdx.rsrc are non-trivial. Note - The SMA (Systems Management Agent) is the default SNMP agent in the Solaris operating system. See netsnmp(5). snmpdx is Obsolete and may not be supported in a future release of Solaris. OPTIONS
The following options are supported: -afilename Specify the full path of the access control file used by the Master Agent. The default access control file is /etc/snmp/conf/snmpdx.acl. -cconfig-dir Specify the full path of the directory containing the Master Agent configuration files. The default directory is /etc/snmp/conf. -ddebug-level Debug. Levels from 0 to 4 are supported, giving various levels of debug information. The default is 0 which means no debug information is given. -h Help. Print the command line usage. -ifilename Specify the full path of the enterprise-name OID map. This file contains the PID used by the Master Agent for recov- ery after a crash. It contains tuples of the UNIX process ID, port number, resource name, and agent name. The default file is /var/snmp/snmpdx.st. -m GROUP | -m SPLIT Specify the mode to use for forwarding of SNMP requests. GROUP Multiple variables can be included in each request from the Master Agent to the subagents. This results in, at mose, one send-request per agent. SPLIT Each variable in the incoming request results in one send-request to each subagent. The default is GROUP. -ofilename Specify the full path of the file containing the tuple (enterprise-name, OID). For example, (Sun Microsystems, 1.3.1.6.1.4.32). The Master Agent uses this file as a base for look-up in the trap-filtering and forwarding process. The default file is /etc/snmp/conf/enterprises.oid. -pport Specify the port number. The default port number is 161. -rfilename Specify the full path of the resource file to be used by the Master Agent. This file stores information about the subagents that the Master Agent invokes and manages. The default resource file is /etc/snmp/conf/snmpdx.rsrc. -y Set a recovery indicator to invoke the recovery module. The recovery process discovers which subagents in the previ- ous session are still active; those subagents not active are re-spawned by the Master Agent. FILES
/etc/snmp/conf/enterprises.oid Enterprise-name OID map /etc/snmp/conf/snmpdx.acl Access control file /etc/snmp/conf/snmpdx.rsrc Resource configuration file /var/snmp/snmpdx.st Master Agent status file /var/snmp/mib/snmpdx.mib Master Agent MIB file EXIT STATUS
The following error values are returned: 0 Successful completion. non-zero An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsasnm | +-----------------------------+-----------------------------+ |Interface Stability |Obsolete | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), netsnmp(5), smf(5) NOTES
The snmpdx service is managed by the service management facility, smf(5), under the service identifier: svc:/application/management/snmpdx Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using svcadm(1M). The ser- vice's status can be queried using the svcs(1) command. SunOS 5.11 2 May 2006 snmpdx(1M)
All times are GMT -4. The time now is 02:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy