Sponsored Content
Full Discussion: Create an array with awk
Top Forums UNIX for Dummies Questions & Answers Create an array with awk Post 302231740 by philipz on Wednesday 3rd of September 2008 05:04:23 AM
Old 09-03-2008
Create an array with awk

List,

I want to have an array created of a particular item in the following textfile:

router> show user
Se4/0:29 site1 Sync PPP - Bundle: Di372
Se5/0:29 site2 Sync PPP - Bundle: Di340
router>

The array should have 2 entries, site1 and site2

I tried with the following:
ISDNSITES=`grep Bundle isdn.htm | awk '{print $2}'`

Although I get the correct output, it only has one array element, "site1 site2". How can I create multiple elements here?

Thanks a lot for the help!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

create array holding characters from sring then echo array.

Hi, I wish to store $string1 in $string1array a character in each array element. Then i wish to echo the entire array to the screen so that it reads as the normal string again. I have been trying with the code below but does not work. Please help... To put string into array: ... (5 Replies)
Discussion started by: rorey_breaker
5 Replies

2. UNIX for Advanced & Expert Users

Create RAID - Smart Array Tool - ML370

Hi guys, i must install an old old old ml370 server... I must create a RAID 5 with my 4 SCSI disk. I need a SmartStart disk for create it or a Floppy Disk called "Array configuration Tool". I don't find it on the hp website...:mad::mad::mad: Anyone have it?? Thanks in advance. Zio (0 Replies)
Discussion started by: Zio Bill
0 Replies

3. Shell Programming and Scripting

How do I create an array from a file using every 3rd line

A file contains the following information shown below. Every ceName has 2 consecutive lines that have to be evaluated, using awk, sed, cut (any common unix tools). Input file: ceName: Node-1 processName: tzMgmt Status: PROCESS_NOT_RUNNING ceName: Node-2 processName: tzMgmt Status:... (15 Replies)
Discussion started by: BRH
15 Replies

4. Shell Programming and Scripting

How to create dynamically associative array in PHP?

Hi, I have an html page like this: <html> <body> <form action="test.php" method = "post"> Enter your name:<input name="search" type = "text" size ="40"> <br> Enter your age:<input name="age" type = "text" size ="20"> <input type = "submit" name="submit" value="search"> <input type =... (1 Reply)
Discussion started by: vanitham
1 Replies

5. Shell Programming and Scripting

every time user input create array perl

Hi, How to create array every time user input and store user input and display all array print " Enter input " my @input = split(' ', $input) chmop($input = <STDIN>; foreach ($input) { @array= @input; } print @array"\n"; (1 Reply)
Discussion started by: guidely
1 Replies

6. Shell Programming and Scripting

how to create an array

Hi, is there a faster way to create an array containing list of numbers? something like the ones below. array=(01 02 03 04 05 06 07 08 09 10 11 ... 365) thanks much. (4 Replies)
Discussion started by: ida1215
4 Replies

7. UNIX for Dummies Questions & Answers

create an array of numbers in awk

Hi ! I try to create an array of a large amount of numbers in increasing order from 1 to 10,000 (or even infinity). Is there an easier way to do that than writing: split("1,2,3,4,5,6,7,8,9,10,11,12,13,14,..............,10000",numbers,",") Doing something like: split(,numbers) Thanks ! (2 Replies)
Discussion started by: lucasvs
2 Replies

8. Shell Programming and Scripting

How to Assign an shell array to awk array?

Hello All, Can you please help me with the below. #!/bin/bash ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1" ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies

9. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

10. OS X (Apple)

Create a bash array from a flat file of whitespaces only.

Hi guys and gals... MacBook Pro. OSX 10.13.2, default bash terminal. I have a flat file 1920 bytes in size of whitespaces only. I need to put every single whitespace character into a bash array cell. Below are two methods that work, but both are seriously ugly. The first one requires that I... (7 Replies)
Discussion started by: wisecracker
7 Replies
CHECKSENDMAIL(8)					    BSD System Manager's Manual 					  CHECKSENDMAIL(8)

NAME
checksendmail -- verify sendmail address transformations. SYNOPSIS
checksendmail [-a] [-d] [-b] [-C file.cf] [-b sendmail_binary] [-l log_file] [-r resolve] [-T test.address] DESCRIPTION
The checksendmail program is a perl script that aids the testing of sendmail(8) 's various configuration files. checksendmail passes typical addresses (supplied in input files) through sendmail and prints the results of the resolution and transformation routines. The input files contain a list of addresses, one per line. For example: user user@site user@site.com The input file can contain comments started with a # and blank lines. OPTIONS
-a Show aliasing of local addresses in mail address resolution phase of testing -d Preceed each address translation line with ruleset sequence summary -C file.cf Use the sendmail configuration file file.cf instead of the default /etc/sendmail.cf file. -b sendmail_binary Use the specified sendmail_binary as the path to invoke sendmail (instead of /usr/sbin/sendmail). -l log_file Log sendmail address test mode debugging output to log_file -r resolve Use resolve as the input file for the addresses to be used for mail resolving. Defaults to address.resolve. -T test.address Use test.address as the single address to test. Cannot be used in conjunction with file setting flags. EXAMPLES
The following command will pass the addresses in address.resolve through sendmail using the configuration information in myconfig.cf. example% cat address.resolve user user@site user@site.com example% checksendmail -C myconfig.cf system: myhost.gadget.com current dir: /tmp/Checksendmail resolve file: address.resolve sendmail binary: /usr/sbin/sendmail sendmail version: 8.9.3 config file: /etc/sendmail.cf config file version: V8/Berkeley Mail address resolution user --(ether )--> user[rmtc] user@site --(ether )--> user@site[rmtc] user@site.com --(ether )--> user@site.com[rmtc] `To' address transformations for mailer ether: user ----> user user@site ----> user@site user@site.com ----> user@site.com `From' address transformations for mailer ether: user ----> user user@site ----> user user@site.com ----> user The first section of the output shows how the addresses in the input files are resolved by sendmail(8). Consider the following output line: user@site.com --(ether )--> user@site.com[rmtc] The input address user@site.com resolves to use the ether mailer. That mailer is directed to send the mail to to the user user@site.com at site rmtc (as indicated in the square brackets). The two later sections of output show how the addresses specified as the To and From address are transformed in the text of the headers. In the example above, the To addresses are untouched. The From addresses, however, all lose their machine information on the way through the mailer: user@site ----> user This may be desirable when using a configuration file on a workstation which is to be hidden as a mailhost from the rest of the network. The following is a set of addresses used at one site for the purposes of testing address resolution. Comments after the addresses detail why particular addresses are present: user Standard trivial address user@rmtc qualified at one level user@rmtc.central qualified at two levels user@rmtc.central.sun.com qualified all the way rmtc!user local but specified as uucp user@summit a workstation (normally delivered locally, though) user@summit.central same but more qualified user@summit.central.sun.com same but fully qualified summit!user same but specified as uucp user@prisma Backward compatibility tests user@prisma.com prisma!user user@central Superior domain testing user@machine.central more qualified, but unknown user@summit.central more qualified and known user@eng name in faraway domain user@machine.eng unknown machine in faraway domain user@summit.eng local machine, far away domain user@hoback far away machine user@machine apparently local but unknown machine user@sun.com Standard trivial address user@machine.dom.sun.com fully qualified but unknown machine user@foo.com standard, known, really far away domain user@foo.dom standard, unknown, really far away domain site!user Single level uucp site1!site2!user Double level uucp user@foo.dom@bar.dom Trickier address site!user@foo.dom Mixed uucp/domain site!user@uunet.uu.net Mixed double uucp/domain NOTES
Note that checksendmail is a perl script. If your site does not have perl(1), it can be obtained via anonymous ftp from ftp.uu.net. sendmail requires that the user have access to directory specified by the OQ parameter in the configuration file (normally /usr/spool/mqueue). checksendmail verifies that the user has access to this directory before allowing the test to continue. AUTHORS
Gene Kim Rob Kolstad Jeff Polk Modified by Robert Harker SEE ALSO
sendmail(8) BSD
November 14, 2000 BSD
All times are GMT -4. The time now is 01:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy