Sponsored Content
Top Forums Shell Programming and Scripting Grep echo awk print all output on one line Post 302968912 by RudiC on Wednesday 16th of March 2016 04:18:45 AM
Old 03-16-2016
Glad to hear!

You seem a bit undecided if the trailing / should appear in your device string or not after getting rid of the file name. The sub (...) is there for exactly that - remove the show.version part, so your cut should be unnecessary. Obviously, the sub doesn't do what it is expected to. I guess that due to the space that you introduced which was not present in my original proposal. Playing around a bit with the regex in sub might bring you to where you want to be. You could also substitute the exact string : sub ("show.version", "", FILENAME).

I'm somewhat surprised of the key that you use in sort...

Last edited by RudiC; 03-16-2016 at 05:24 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I output or echo NONE if grep does not find anything?

I am performing a grep command and I need to know how to echo "NONE" or "0" to my file if grep does not find what i am looking for. echo What i found >> My_File grep "SOMETHING" >> My_File I am sure this is easy, I am sort of new at this! Thanks (2 Replies)
Discussion started by: jojojmac5
2 Replies

2. Shell Programming and Scripting

awk help required to group output and print a part of group line and original line

Hi, Need awk help to group and print lines to format the output as shown below INPUT FORMAT set echo on set heading on set spool on /* SCHEMA1 */ CREATE TABLE T1; /* SCHEMA1 */ CREATE TABLE T2; /* SCHEMA1 */ CREATE TABLE T3; /* SCHEMA1 */ CREATE TABLE T4; /* SCHEMA1 */ CREATE TABLE T5;... (5 Replies)
Discussion started by: rajan_san
5 Replies

3. Shell Programming and Scripting

Awk+Grep Input file needs to match a column and print the entire line

I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this). For example, i have a input file1.txt: cat inputfile1.txt 218299910417 1172051195 1172070231 1172073514 1183135117 1183135118 1183135119 1281440202 ... (3 Replies)
Discussion started by: poliver
3 Replies

4. UNIX for Dummies Questions & Answers

Grep /Awk letters X - X in every line and print it as a mac address

hey i m kinda new to this so i will appreciate any help , i have this list of values: pwwn = 0x50012482009cd7a7 nwwn=0x50012482009cd7a6 port_id = 0x280200 pwwn = 0x5001248201bcd7a7 nwwn=0x5001248201bcd7a6 port_id = 0x280300 pwwn = 0x50012482009c51ad nwwn=0x50012482009c51ac port_id =... (4 Replies)
Discussion started by: boaz733
4 Replies

5. Shell Programming and Scripting

Print (echo) variable in a single line

Hi, I have written this code ------------------------------------------------ # !/bin/ksh i=0 while do j=$i while do echo -e $j #printf "%d",$j j=`expr $j - 1` done echo i=`expr $i + 1` done ---------------------------------------------------- The ouput which... (2 Replies)
Discussion started by: rac
2 Replies

6. Shell Programming and Scripting

Use less pipe for grep or awk sed to print the line not include xx yy zz

cat file |grep -v "xx" | grep -v "yy" |grep -v "zz" (3 Replies)
Discussion started by: yanglei_fage
3 Replies

7. Shell Programming and Scripting

Echo printing a line in 2 lines; expected to print in one line

Dear All, fileName: therm.txt nc3h7o2h 7/27/98 thermc 3h 8o 2 0g 300.000 5000.000 1390.000 41 1.47017550e+01 1.71731699e-02-5.91205329e-06 9.21842570e-10-5.36438880e-14 2 -2.99988556e+04-4.93387892e+01 2.34710908e+00 4.34517484e-02-2.65357553e-05 3 ... (7 Replies)
Discussion started by: linuxUser_
7 Replies

8. Shell Programming and Scripting

Print awk output in same line ,For loop

My code is something like below. #/bin/bash for i in `ps -ef | grep pmon | grep -v bash | grep -v grep | grep -v perl | grep -v asm | grep -v MGMT|awk '{print $1" "$8}'` do echo $i ORACLE_SID=`echo $line | awk '{print $2}'` USERNAME=`echo $line | awk '{print $1}'` done ============= But... (3 Replies)
Discussion started by: tapia
3 Replies

9. Shell Programming and Scripting

(n)awk: print regex search output lines in one line

Hello. I have been looking high and low for the solution for this. I seems there should be a simple answer, but alas. I have a big xml file, and I need to extract certain information from specific items. The information I need can be found between a specific set of tags. let's call them... (2 Replies)
Discussion started by: Tobias-Reiper
2 Replies

10. Shell Programming and Scripting

Echo print on same line while loop using variable

Currently using below script but echo it print the output in two line. Input file all-vm-final-2.txt CEALA08893 SDDC_SCUN DS_SIO_Workload_SAPUI_UAT_01 4 CEALA09546 SDDC_SCUN DS-SIO-PD5_Workload_UAT_SP1_Flash_07 4 CEALA09702 SDDC_SCUN DS-VSAN-RMP-WORKLOAD01 4 DEALA08762 SDDC_LDC... (3 Replies)
Discussion started by: ranjancom2000
3 Replies
show mapping(1m)														  show mapping(1m)

NAME
show mapping - Shows the elements of the either the local or a remote endpoint map SYNOPSIS
rpccp show mapping [host-address] [-i if-id [-v versions]] [-o object-uuid [ -o object-uuid...]] OPTIONS
Defines an interface identifier to be shown (optional). Only one interface can be shown in a single operation. If specified, only ele- ments containing this interface identifier are shown. The -i option can be qualified by the -v option. The value has the following form: interface-uuid,major-version.minor-version The UUID is a hexadecimal string and the version numbers are decimal strings, for example: -i ec1eeb60-5943-11c9-a309-08002b102989,1.1 Leading zeros in version numbers are ignored. Indicates how a specified interface version is used (optional). If it is used without the -i option, the -v option is ignored. The possible combinations of versions for the -v option and their actions are described in the fol- lowing table. --------------------------------------------------- +-----------+-------------------------------------+ |Versions | Action | +-----------+-------------------------------------+ |all | The interface version is ignored. | |exact | Both the major and minor versions | | | must match the specified versions. | |compatible | The major version must match the | | | specified version, and the minor | | | version must be greater than or | | | equal to the specified version. | |major_only | The major version must match the | | | specified version; the minor ver- | | | sion is ignored. | |upto | The major version must be less than | | | or equal to that specified. If the | | | major versions are equal, the minor | | | version must be less than or equal | | | to that specified. | +-----------+-------------------------------------+ +-----------+-------------------------------------+ If the -v option is absent, the command shows compatible version numbers. Defines an object to be shown (optional). Each show mapping command accepts up to 32 -o options. The UUID is a hexadecimal string, for example: -o 3c6b8f60-5945-11c9-a236-08002b102989 ARGUMENTS
The host-address argument is a string binding that indicates where to find the target endpoint map. When accessing the local endpoint map, you can specify which protocol sequence to use (optional); for example, ncadg_ip_udp: When accessing a remote endpoint map, you must spec- ify both a protocol sequence and a network address for the remote system (required); for example, ncadg_ip_udp:16.20.16.44 An endpoint is unnecessary in local or remote host addresses, and the remove mapping command ignores any endpoint specified as part of a host address. DESCRIPTION
The show mapping command shows elements of an endpoint map. Each element corresponds to an object UUID, interface identifier, annotation, and binding information. The binding information contains an RPC protocol sequence, a network address, and an endpoint within square brack- ets (rpc- prot-seq:network-addr[endpoint]). The endpoint map can be either the local endpoint map or the endpoint map of a specified remote host. If entered without a remote host address, the command accesses the local endpoint map. For the local endpoint map, a show mapping command without any options displays all the map elements. For a remote endpoint map, map elements are accessible only for protocol sequences that are supported on both your system and the remote system. The options list a selected subset of map elements. The - i option selects a specific interface, and the -v option qualifies the -i option. The -o object selects a specific object. You can use from 0 to 32 -o options per command. The options work together to specify the subset of elements for the target protocol sequence(s). NOTES
Note that to ensure that you can remotely display all map elements from every remote endpoint map, run the RPC control program on a system that supports all of the protocol sequences available in your network environment. This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLES
The following commands start the control program and show the map elements in the local endpoint map that contain the specified interface identifier: $ rpccp rpccp> show mapping -i ec1eeb60-5943-11c9-a309-08002b102989,1.1 The following rpccp show mapping command operates from the system prompt. The command accesses the endpoint map of the remote host speci- fied by the host address (ncadg_ip_udp:16.20.16.44) and displays the one map element that contains both the specified interface identifier and the specified object UUID: $ rpccp show mapping > -i ec1eeb60-5943-11c9-a309-08002b102989,1.1 > -o 30dbeea0-fb6c-11c9-8eea-08002b0f4528 > ncadg_ip_udp:16.20.16.44 RELATED INFORMATION
Commands: remove mapping(1m), show server(1m) show mapping(1m)
All times are GMT -4. The time now is 03:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy