Sponsored Content
Top Forums Shell Programming and Scripting Other way aside from putting more PIPES (|) Post 302918195 by kenshinhimura on Monday 22nd of September 2014 09:38:35 AM
Old 09-22-2014
Other way aside from putting more PIPES (|)

I already manage to get the output that i want.. but wat if removing all the pipes and convert it 1 liner with less pipes. My command below can get the ouput that i want. i just want to remove the pipes or less pipes.

Code:
#cat file1
us-west-2a running i-3397a421 192-11-1-10.us-west-2.compute.internal 
us-west-2a running i-33af9c21 192-11-1-11.us-west-2.compute.internal 

Command i use:
 cat file1 |awk '{gsub("ip-","",$4)}1'|awk '{gsub("-",".",$4)}1'|awk '{gsub(".us.west.2.compute.internal","\t",$4)}1'

Output:
#cat file1
us-west-2a running  i-3397a421  192.11.1.10        None
us-west-2a running i-33af9c21 192.11.1.11        None

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Putting pC on network

How do I put a my PC with linux 7.0 on a class B network. Can someone give me info or text that will guide me? (1 Reply)
Discussion started by: Rush
1 Replies

2. Programming

Putting breakpoint on core

Any one tried puting breakpoint while debugging a core file? I have been using a gdb for running it.. But unsuccessful to put a breakpoint before executing it. Any sugestion or tool for doing it would be welcomed.. Thanks :) (0 Replies)
Discussion started by: jyotipg
0 Replies

3. Filesystems, Disks and Memory

PIPEs and Named PIPEs (FIFO) Buffer size

Hello! How I can increase or decrease predefined pipe buffer size? System FreeBSD 4.9 and RedHat Linux 9.0 Thanks! (1 Reply)
Discussion started by: Jus
1 Replies

4. UNIX for Dummies Questions & Answers

Putting Wallpaper on the Desktop

How do I put wallpaper from the internet on the Unix desktop? For example, I want to know how to perform the same operation as "right click-> Set as Wallpaper" on a graphics on a web page, in Windows. Thanks! :rolleyes: (3 Replies)
Discussion started by: pireifej
3 Replies

5. Shell Programming and Scripting

Putting a character between two other characters?

I need to separate Pascal style identifiers (TheyLookLikeThis) into words separated by an underscore (_). I've tried sed 's//&_&/' but this won't work (obviously). I'd love some help. (4 Replies)
Discussion started by: Ilja
4 Replies

6. UNIX for Dummies Questions & Answers

putting Linux on an old windows PC

Hello, I was just reading around these forums when I had an idea, without being able to really answer my question for myself due to some circumstances, so hopefully someone can give me a hand. I have an old desktop PC that has served me very well. I got an Asus G73JH though, so I mostly used the... (2 Replies)
Discussion started by: Patriots12
2 Replies

7. Programming

putting numbers behind eachother

I want to make a program where you have to insert binary numbers like this: do { iBinary = getche(); }while(iBinary == 1 || iBinary == 0); after you get the numbers I want them to be placed behind eachother so you will get: input: 1 1 0 1 output: 1101 (7 Replies)
Discussion started by: metal005
7 Replies

8. Shell Programming and Scripting

putting two images together

Hi, I generated many figures in .png format (approximately 120). Right now I need to pair the figures on a single page so that the files with the same file name (i.e. jack) that end with .matrix.png are placed on the left and .cdt.png is on the right (so jack.matrix.png with jack.cdt.png... (6 Replies)
Discussion started by: kylle345
6 Replies

9. UNIX for Dummies Questions & Answers

Putting $$ before filename

Hello , I am searching a directory for a file and have to assign the filename to a variable . The variable must have form $$filename So my code is echo "'$$filename='`ls -lrt *PreMatch*.csv| head -1 | nawk '{print $9}'`" however $$ is converting to a number . How could I make it $$... (3 Replies)
Discussion started by: Pratik4891
3 Replies

10. Hardware

Putting an old hd in a new computer

What are the steps you need to take when you put an old HD in a new computer? I just did this. Every time it makes it to the windows boot screen then restarts. I have a bunch of old engineering software that is not compatible with the newer versions of windows. I figured this out after I bought... (6 Replies)
Discussion started by: cokedude
6 Replies
nis_groups(3NSL)				       Networking Services Library Functions					  nis_groups(3NSL)

NAME
nis_groups, nis_ismember, nis_addmember, nis_removemember, nis_creategroup, nis_destroygroup, nis_verifygroup, nis_print_group_entry - NIS+ group manipulation functions SYNOPSIS
cc [ flag ... ] file ... -lnsl [ library ... ] #include <rpcsvc/nis.h> bool_t nis_ismember(nis_name principal, nis_name group); nis_error nis_addmember(nis_name member, nis_name group); nis_error nis_removemember(nis_name member, nis_name group); nis_error nis_creategroup(nis_name group, uint_t flags); nis_error nis_destroygroup(nis_name group); void nis_print_group_entry(nis_name group); nis_error nis_verifygroup(nis_name group); DESCRIPTION
These functions manipulate NIS+ groups. They are used by NIS+ clients and servers, and are the interfaces to the group authorization object. The names of NIS+ groups are syntactically similar to names of NIS+ objects but they occupy a separate namespace. A group named "a.b.c.d." is represented by a NIS+ group object named "a.groups_dir.b.c.d."; the functions described here all expect the name of the group, not the name of the corresponding group object. There are three types of group members: o An explicit member is just a NIS+ principal-name, for example "wickedwitch.west.oz." o An implicit ("domain") member, written "*.west.oz.", means that all principals in the given domain belong to this member. No other forms of wildcarding are allowed: "wickedwitch.*.oz." is invalid, as is "wickedwitch.west.*.". Note that principals in subdomains of the given domain are not included. o A recursive ("group") member, written "@cowards.oz.", refers to another group. All principals that belong to that group are considered to belong here. Any member may be made negative by prefixing it with a minus sign ('-'). A group may thus contain explicit, implicit, recursive, negative explicit, negative implicit, and negative recursive members. A principal is considered to belong to a group if it belongs to at least one non-negative group member of the group and belongs to no nega- tive group members. The nis_ismember() function returns TRUE if it can establish that principal belongs to group; otherwise it returns FALSE. The nis_addmember() and nis_removemember() functions add or remove a member. They do not check whether the member is valid. The user must have read and modify rights for the group in question. The nis_creategroup() and nis_destroygroup() functions create and destroy group objects. The user must have create or destroy rights, respectively, for the groups_dir directory in the appropriate domain. The parameter flags to nis_creategroup() is currently unused and should be set to zero. The nis_print_group_entry() function lists a group's members on the standard output. The nis_verifygroup() function returns NIS_SUCCESS if the given group exists, otherwise it returns an error code. These functions only accept fully-qualified NIS+ names. A group is represented by a NIS+ object with a variant part that is defined in the group_obj structure. See nis_objects(3NSL). It con- tains the following fields: uint_t gr_flags; /* Interpretation Flags (currently unused) */ struct { uint_t gr_members_len; nis_name *gr_members_val; } gr_members; /* Array of members */ NIS+ servers and clients maintain a local cache of expanded groups to enhance their performance when checking for group membership. Should the membership of a group change, servers and clients with that group cached will not see the change until either the group cache has expired or it is explicitly flushed. A server's cache may be flushed programmatically by calling the nis_servstate() function with tag TAG_GCACHE and a value of 1. There are currently no known methods for nis_ismember(), nis_print_group_entry(), and nis_verifygroup() to get their answers from only the master server. EXAMPLES
Example 1: Simple Memberships Given a group sadsouls.oz. with members tinman.oz., lion.oz., and scarecrow.oz., the function call bool_var = nis_ismember("lion.oz.", "sadsouls.oz."); will return 1 (TRUE) and the function call bool_var = nis_ismember("toto.oz.", "sadsouls.oz."); will return 0 (FALSE). Example 2: Implicit Memberships Given a group baddies.oz., with members wickedwitch.west.oz. and *.monkeys.west.oz., the function call bool_var = nis_ismem- ber("hogan.monkeys.west.oz.", "baddies.oz."); will return 1 (TRUE) because any principal from the monkeys.west.oz. domain belongs to the implicit group *.monkeys.west.oz., but the function call bool_var = nis_ismember("hogan.big.monkeys.west.oz.", "baddies.oz."); will return 0 (FALSE). Example 3: Recursive Memberships Given a group goodandbad.oz., with members toto.kansas, @sadsouls.oz., and @baddies.oz., and the groups sadsouls.oz. and baddies.oz. defined above, the function call bool_var = nis_ismember("wickedwitch.west.oz.", "goodandbad.oz."); will return 1 (TRUE), because wickedwitch.west.oz. is a member of the baddies.oz. group which is recursively included in the goodand- bad.oz. group. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
nisgrpadm(1), nis_objects(3NSL), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 18 Dec 2001 nis_groups(3NSL)
All times are GMT -4. The time now is 05:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy