Without doing much testing, I think that -a is sort of the same as the empty or no-opt version before, which I proposed to solve with X="*". As you showed that the ...**... did not work for the awk input stream, X="" might do, but this is already used to tell correct from incorrect parameters. There's two possible ways to go - either prefix an * to every X definition, and remove the explicit * from the awk command, or define X=NoOpt for example at the start of the function, and preceding the awk test for this string instead for the empty string.
I decided to not go with -a|allbecause it's just completely against what the cverfunction is about. It's not very practical, and I don't think anyone would want to do it anyway. It was a thing to try for fun.
I did try your suggestions, and here's what happened.
"prefix an * to every Xdefinition, and remove the explicit *from the awkcommand" gave me the ...**... issue again.
"define X=NoOpt for example at the start of the function, and preceding the awk" caused cver alone to try to search for ...NoOpt.domain.net
I'm still looking into assigning ?for help. I haven't really come across anything useful yet, but if/when I do I will share.
---------- Post updated at 05:19 PM ---------- Previous update was at 04:52 PM ----------
Alright, I believe I found the answer. ?is already in use basically, so you can't define it. It seems that using -his the command commonly used in place of ?
It's easier for me to impose my will upon others (aka make them use -h) haha! I did pick up on that getopt/getopts loop from my digging around on the internet. Good thing it's not important and -hworks.
There's a script someone created that helps in digging up customer equipment configs that's fairly robust, and whoever created it also opted for -hfor help. Since people are used to that already, I don't need to make ?work.
I wanted to play more with this to make -vbe the actual command someone types to search out the software version instead of using the 3rd column of the command ($3) as the thing that triggers the search.
Ex:
Instead of:
So I got to thinking how that could be possible, and I don't know if this is possible or not, but here's what I had in mind...
1) Remove -vSRCH="$3" and SRCHfrom the awkcommand.
2) In the case, assign -vand have it contain the $5 ~ "^[[]" part of my awk
3) -v then "injects" the awkcode between &&and {sub(...) and still runs like it does now.
Again, I'm not sure if this is possible, but it would please this tiny voice in my mind saying "Yeah it works, but not the exact way you intended". I tried doing it on my own, but -vdoesn't do anything, but also doesn't break my other commands luckily.
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)
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)
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)
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)
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)
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 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)