Search Results

Search: Posts Made By: CiCa
3,063
Posted By CiCa
Ahh haa - it was the $ sign in val=$ that I...
Ahh haa - it was the $ sign in val=$ that I needed...

This looks to be a good starting point to let me proceed with the rest of the script - thanks ahamed101.

Just out of curiosity, can you...
3,063
Posted By CiCa
ok - thanks. Back to my original question...
ok - thanks.

Back to my original question then - anyone know if there is a way to assign $3 and $5 to shell variables inside the {} brackets...

Thanks in advance
CiCa
3,063
Posted By CiCa
I just Googled array usage and then realised that...
I just Googled array usage and then realised that too - my mistake. :o

Although have I missed a | in the following:
root[my-box]# while read line; do
val=(pntadm -P $line | awk '{if (( $2 == 00...
3,063
Posted By CiCa
Thanks Ahamed101 - unfortunately though, my...
Thanks Ahamed101 - unfortunately though, my knowledge around arrays and their usage is pretty limited e.g. how do I then read these values out of the array?

Alternatively, do you know of a way of...
3,063
Posted By CiCa
Thanks Hanson44 - I could do it that way, but I...
Thanks Hanson44 - I could do it that way, but I was really hoping to assign $3 and $5 to shell variables inside the {} brackets (assuming that it is actually possible?)...

Just to make the picture...
3,063
Posted By CiCa
Hi Alister, Essentially what I am trying to...
Hi Alister,

Essentially what I am trying to get here is pick out list of IP addresses from dhcp pool on a Solaris (dhcp) server where certain criteria are matched.

/tmp/subnet_list - contains a...
3,063
Posted By CiCa
Variable assignment inside awk
Hi,

Was hoping someone could help with the following:

while read line; do pntadm -P $line | awk '{if (( $2 == 00 && $1 != 00 ) || ( $2 == 04 )) print $3,$5}'; done < /tmp/subnet_list

Anyone...
11,495
Posted By CiCa
Thanks RudiC... The problem I have with the...
Thanks RudiC...

The problem I have with the dates, is that pntadm -P <subnet> outputs the date for each IP address on that subnet in the mm/dd/yyyy format, this is why I took the current date and...
11,495
Posted By CiCa
Cannot make pipe for process substitution: Too many open files
Hi,

I've came across an issue with a script I've been writing to check DHCP addresses on an Solaris system, the script has been running reasonably well, until it hit the following problem:
...
Forum: Solaris 02-14-2013
3,574
Posted By CiCa
Hmm - not sure if that's actually worked. ...
Hmm - not sure if that's actually worked.

I've compared two BE's that I know are at different patch levels e.g.


root[mybox]#
root[mybox]# df -h .
Filesystem size used avail...
Forum: Solaris 02-14-2013
3,574
Posted By CiCa
Kernel Patch level of ABE.
Hi,

Anyone able to advise on how to find the kernel patch level of an ABE?

showrev and uname -a will provide kernel patch details of the running environment, but how can I run these commands...
1,557
Posted By CiCa
Brilliant! root[my-box]# /usr/xpg4/bin/grep...
Brilliant!

root[my-box]# /usr/xpg4/bin/grep -vxFf <(grep -v "#|^$" /tmp/exemption_list) /tmp/subnet_list
aaa.bbb.ccc.111
aaa.bbb.ccc.333
aaa.bbb.ccc.555
aaa.bbb.ccc.777
aaa.bbb.ccc.888...
1,557
Posted By CiCa
I tried something similar a day or two ago, but...
I tried something similar a day or two ago, but -F or -f ain't an option on my system

root[my-box]# grep -vF /tmp/exemption_list /tmp/subnet_list
grep: illegal option -- F
Usage: grep -hblcnsviw...
1,557
Posted By CiCa
Repeative Output
Folks,

Not got much scritping experience, so I expect this will be a fairly trivial fix for those that know what they're doing...

I've got two files:

root[my-box]# cat /tmp/exemption_list
#...
896
Posted By CiCa
Scrutinizer - Solaris 10... Just had an idea...
Scrutinizer - Solaris 10...

Just had an idea and changing to ksh (and not bash) allows the script to run without issue - yay! :)

Although - do you know if there is a way to automatically change...
896
Posted By CiCa
A ( too many?
Anyone able to assist with the following:

#!/bin/ksh

-- snip --

echo "\n\nEnter number associated with the change: \c"
read inc_num
if [[ "$inc_num" = ?...
3,723
Posted By CiCa
Yup - I think changing to bash is probably the...
Yup - I think changing to bash is probably the best option here, cause it's been tested in bash and it works...

I'll just need to change all my "print" commands to "echo"

More to follow...
3,723
Posted By CiCa
Apologies for the delayed reply... ...
Apologies for the delayed reply...

Scrutinizer - what am I missing here:

-- snip --

subnet ()
{

clear
while true
do
echo "\n "
echo...
3,723
Posted By CiCa
Output: Please enter the subnet to be...
Output:

Please enter the subnet to be changed: 111.222.333.0
root 3765 3755 0 Jun 29 pts/2 0:02 -bash
root 20968 3765 0 13:31:46 pts/2 0:00 /bin/ksh...
3,723
Posted By CiCa
Solaris 10 and grep is SUNWggrp 11.10.0. ...
Solaris 10 and grep is SUNWggrp 11.10.0.

Also I'm trying to write the above code in ksh
3,723
Posted By CiCa
Sorry for the lack info/clarity... Basically...
Sorry for the lack info/clarity...

Basically the subnet file will contain a list of subnets where the first to values (111.222 in this case) will not change so entries could be as follows:
...
3,723
Posted By CiCa
The above code works in bash - although I'm using...
The above code works in bash - although I'm using ksh in this instance.
3,723
Posted By CiCa
Matching text using grep
Hi folks...

Relatively new to scripting, but really struggling with something that will no doubt be second nature to most people on here:

Trying to get an exact match on $sub, where sub is an...
Showing results 1 to 23 of 23

 
All times are GMT -4. The time now is 05:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy