Sponsored Content
Top Forums Shell Programming and Scripting Help with a simple script using awk Post 302093617 by alexcol on Friday 20th of October 2006 11:11:42 PM
Old 10-21-2006
Tools Help with a simple script using awk

I need a hand with this simple script,
in Unix i have a variable called portal:
$ echo $portal
chu0
when i use awk this variable is not recognized. How can i make awk recognize and print the value of this variable, since the output is not shown i.e.

awk '
BEGIN {printf("%4s\t%14s\n", "Portal:", portal)}' listacdrs
output:Portal:
Thnaks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simple awk script question

Hi, I'm a total beginner at awk and hope someone can advise what I have done wrong in the following script: I have a file which (to simplify things) may be something like this Fred Smith and Sue Brown Joe Jones and Jane Watts Sally Green and Jim O? Connor Freda O? Reiley and Pat O?... (2 Replies)
Discussion started by: Bab00shka
2 Replies

2. Shell Programming and Scripting

simple awk script...

hi everyone, i have a script that I use regulary to look through my files and directories it works fine, but I would like to add a segment to the script to make the output more readable and userfriendly.. (i am not an expert on scripts so there is no comments or status exits as of yet.. )... (3 Replies)
Discussion started by: moxxx68
3 Replies

3. Shell Programming and Scripting

need help with simple awk/ksh script

I need help finding out why this script wont run. The chmod is okay, but i get an error saying that I need '&&' on line 5. (18 Replies)
Discussion started by: tefflox
18 Replies

4. Shell Programming and Scripting

simple awk

when I execute this awk stmt .. awk "/log_directory/ { print $5}" /opt/dba/oraadmin/tools/tmp_purge_op.log it's returning the whole line as .. IRMD118_LISTENER1 parameter "log_directory" set to /opt/oracle/10.2/network/log/ my expected output is : /opt/oracle/10.2/network/log what... (7 Replies)
Discussion started by: talashil
7 Replies

5. Shell Programming and Scripting

Simple AWK script problem.

Hi all, I have set up a simple awk script to calculate the average of values that are printed out a number of times per second (the number of time the printing occurs varies). The data is of the format shown below: 1 4.43 1 3.65 1 2.45 2 7.65 2 8.23 2 5.65 3 4.65 3 6.21 .. .. 120... (4 Replies)
Discussion started by: omnomtac
4 Replies

6. UNIX for Dummies Questions & Answers

Simple awk script for positional replacement in text?

I have a string of letters. (They happen to be DNA, not that it's relevant to the question.) For analysis purposes, I need to replace the information at some of the sites. I need to do this based on their position, not the information in that position. I also need to ignore differences at other... (10 Replies)
Discussion started by: JFS
10 Replies

7. Shell Programming and Scripting

help with simple awk script

Hi, I just don't understand awk. I think I'm close here but can someone give me a hand to finish this little parsing routine ? the input file is formatted like this: District 2502110 Gsub 2384889 Gsub 1428180 District 2502220 Gsub 1466390 Gsub 1466389 Gsub 1466388 Gsub 1466386 Gsub... (4 Replies)
Discussion started by: fwellers
4 Replies

8. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

9. Shell Programming and Scripting

Simple awk script needed

but I'm stumped...please help I have a file like this....... 1000 1 34 1000 10 34 1000 11 35 1000 20 35 1000 21 36 1000 30 36 2000 1 34 2000 10 34 which I would like printed out as 40 lines 1000 1 34 1000 2 34 1000 3 34 1000 4 ... (2 Replies)
Discussion started by: garethsays
2 Replies

10. Shell Programming and Scripting

Simple awk use

Hi, I have a file such that: 40454,31,48,4,1304.967741935484,1 31708,25,48,4,1268.32,1 20900,64501,671,788,0.3240259840932699,0 20137,51358,834,743,0.3920908135051988,0 I want to replace the 6th column by "ones" if it is 1, and with "zeros" if it is 0. Thanks. (6 Replies)
Discussion started by: shekhar2010us
6 Replies
it_tpg_create(3ISCSIT)					iSCSI Management Library Functions				    it_tpg_create(3ISCSIT)

NAME
it_tpg_create, it_tpg_delete, it_tpg_free - create and delete iSCSI target portal groups SYNOPSIS
cc [ flag... ] file... -liscsit [ library... ] #include <libiscsit.h> int it_tpg_create(it_config_t *cfg, it_tpg_t **tpg, char *tpg_name, char *portal_ip_port); int it_tpg_delete(it_config_t *cfg, it_tpg_t *tpg, boolean_t force);); void it_tpg_free(it_tpg_t *tpg); PARAMETERS
cfg a pointer t the iSCSI configuration structure tpg a pointer to the it_tpg_t structure representing the target portal group tpg_name an identifier for the target portal group portal_ip_port a string containing an appropriately formatted IP address:port. Both IPv4 and IPv6 addresses are permitted. This value becomes the first portal in the target portal group. Applications can add additional values using it_portal_create(3ISC- SIT) before committing the target portal group. IPv6 addresses should be enclosed in square brackets ('[', ']'). force boolean value indicating if the target portal group should be removed even if it is associated with one or more targets. If not B_TRUE, the operation will fail if the target product group is associated with a target. DESCRIPTION
The it_tpg_create() function allocates and creates an it_tpg_t structure representing a new iSCSI target portal group. The new it_tpg_t structure is added to the global tpg list (cfg_tgt_list) in the it_config_t structure. The it_tpg_delete() function deletes the target portal group represented by tpg, where tpg is an existing it_tpg_t structure within the global configuration cfg. The it_tpg_free() function deallocates resources associated with an it_tpg_t structure. If tpg->next is not NULL, this function frees all members of the list. Configuration changes as a result of these functions are not instantiated until the modified configuration is committed by calling it_con- fig_commit(3ISCSIT). RETURN VALUES
The it_tpg_create() and it_tpg_delete() functions return 0 on success and an error value on failure. ERRORS
The it_tpg_create() and it_tpg_delete() functions will fail if: EBUSY The portal group is associated with one or more targets. EEXIST The portal was already configured for another portal group associated with this target. EINVAL A parameter is invalid. ENOMEM Resources could not be allocated. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
it_config_commit(3ISCSIT), it_ini_create(3ISCSIT), it_portal_create(3ISCSIT), it_tgt_create(3ISCSIT), libiscsit(3LIB), libnvpair(3LIB), libstmf(3LIB), attributes(5) SunOS 5.11 1 Oct 2008 it_tpg_create(3ISCSIT)
All times are GMT -4. The time now is 04:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy