Hi there, I have a Solaris machine with an ifconfig output similar to below
As you can see I have one physical interface called e1000g0 and three subsequent virtual interfaces on e1000g0. The first one is just a regular secondary virtual interface, but the second and third are attached to Solaris Zones (virtual servers) and subsequently have an extra line in the output defining the zone it is attahced to (in red above). I have to write a process that will cycle through theses 4 interfaces (in this case 1 physical and 3 virtual) populating a variable, lets call it VAR, with the virtual server name found on the lines highlighted in red above (additional example below)
But where there is no "zone <virtualserver name>" line for an interface, be it Physical or Virtual (as with e1000g0 and e1000g0:1) I want to just poulate VAR with a "-"
My question is really, whilst I am happy using awk to set VAR with the value of that line if it existed on ALL interfaces, I am a little unsure as to how I use it to make the determination of whether the line exists for a interface then either grab the value or set it to "-" accordingly ?
would i need to use a mixture of tools to achieve this or can it all be done within awk?
Hello,
I have a table that looks like what is shown below:
AA
BB
CC
XY
PQ
RS
AA
BB
CC
XY
RS
I would like the total counts depending on the set they belong to:
if search pattern is in {AA, BB, CC} --> count them as Type1 | wc -l (3 Replies)
Hi All,
I have a file with following sample data. I am also attaching the file.
(Est) (Est) Jobs Sch
Workstation Job Stream SchedTime State Pr Start Elapse # OK Lim
POOL #ACR_BILLING 0005 08/15 ... (2 Replies)
I've been working on this for 2 days and I'm not getting far. It is time to turn to you guys.
With the data below, I am trying to create a file that looks like this: I'd like to use some form of egrep I think.
AY#box#P04prod_to_contingency s AY#cmd#P04dump_cont_db s AY#cmd#P04get_on_ice_job s... (2 Replies)
Hello,
I am trying to use awk instead of grep command. Is there a way I can search for a pattern and show 10 lines before it (grep -B) using awk ot nawk? (5 Replies)
i have a file that contents multiple instances of the same ERROR.Below the content of the file
ERROR_FILE.txt
Archiver6.log:2009-05-25 17:58:44,385 ERROR - CleanLPDataMessage: Missing Intervals: 2
Archiver6.log:2009-05-25 18:27:36,056 ERROR - CleanLPDataMessage: Missing Intervals: 5... (5 Replies)
Greetings all,
Unix rookie here, just diving into ksh scripting for the first time.
My question may seem confusing but please bear with me:
If I'm understanding everything I'm reading properly, it seems like the ksh language itself doesn't have a lot of string manipulation functions of... (2 Replies)
Hi I'm trying to write a script which takes an integer as input and checks for files with size > input and displays it on screen.
The code I've tried :
echo 'Enter the min file size expected'
read filesize
du -ah <folder name> | awk -F: '$1>int(filesize) {print $1,$2)' is always... (28 Replies)
i am still confusing on how to use sed, grep and awk if the input is not a file but a variable.
such as:
a="hello world"
b="how are you"
c="best wish to you"
d="222,333,444"
what if i want to check which variable $a,$b,$c,$d have contain "you"
what if i want to replace the word "you"... (9 Replies)