Came back to playing with this. I found that just a plan old sortdoes the sort as I need. RudiC, I think you were trying to point me in that direction previously with your questions about why use -k5and-g
After presenting this to the boss, he really liked it and wants to get it implemented in the system for everyone to use, but not without a few changes. This brings me back to a previous problem and introduced new issues (of course, new features = new problems to debug).
What I have currently is:
Which then outputs: [10.0R4.7] /home/clmbn-eng2/a/rwalker/svn/nw_config_data/device-r0.cpe.domain.net
I've been trying to strip this out out /home/clmbn-eng2/a/rwalker/svn/nw_config_data/so that my output looks like this instead [10.0R4.7] device-r0.cpe.domain.netbut I can't get it right. To test it I replaced "/show.version"with the full path, and that got rid of it, but left the /show.version.
RudiC, you had mentioned another sub(...)but I failed horribly at implementing it. I tried setting it up like this:
but I get this error, and I just am not sure how to do it right
Notice that in the path after the /a/is my username. If I want this to work for everyone, I can't have my username there. So, I tried setting it up like this "/home/clmbn-eng2/a/*/svn/nw_config_data/" to use the *as a wildcard, but that doesn't work and just shows me the full path again. I checked the /home/clmbn-eng2/a/directory and I see all the different users there, so I'm wondering if maybe in this instance *doesn't work as a wildcard search? If that's the case, how do I wildcard it to make this command friendly for everyone?
Once I sort out how to wildcard that part of the directory, and remove the filepath up to the device name AND the "/show.version"I can move on to what the boss wants next. He wants one command that contains all 3 cpe subdomains we have that can be hit with a variable like -c, -e, or -o. I'm still researching how to do all the different variables and stuff with awk, so for now I have this setup as a starting point for after I learn some more and figure out the multiple subs to strip out stuff I don't want to show:
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)
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)
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)
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)
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)
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)
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)