Search Results

Search: Posts Made By: rwalker
39,934
Posted By rwalker
It does and doesn't satisfy my needs. Everything...
It does and doesn't satisfy my needs. Everything works fine as is, I'd just prefer to assign -v|veras the only things that can initiate the search of the software version, not anything in $3. Again,...
39,934
Posted By rwalker
Thank you, I will look into that now.
Thank you, I will look into that now.
39,934
Posted By rwalker
Code to reference for post: [ $X ] && awk...
Code to reference for post:
[ $X ] && awk -vSRCH="$3" '/JUNOS/ && /boot/ && $5 ~ "^[[]" SRCH {sub (...);

I wanted to play more with this to make -vbe the actual command someone types to search...
39,934
Posted By rwalker
It's easier for me to impose my will upon others...
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...
39,934
Posted By rwalker
I decided to not go with -a|allbecause it's just...
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...
39,934
Posted By rwalker
No problem. I'm taking my work computer home for...
No problem. I'm taking my work computer home for my weekend so I can spend more time researching this. Now that everything works, there's other little things I want to be able to add in that...
39,934
Posted By rwalker
Forgot to add I tried that too and no luck. ...
Forgot to add I tried that too and no luck.

("?"|"-h"|help)

clmbn-eng2.eng:~% cver ?
zsh: no matches found: ?
39,934
Posted By rwalker
Ah yes, that's right! It's no biggie, I'd rather...
Ah yes, that's right! It's no biggie, I'd rather not go through the trouble of all of that. Everything works exactly as it needs to.

Here it is completed:

cver () {
X=""
case $1 in
("-b")...
39,934
Posted By rwalker
No need to apologize! You've gone way above and...
No need to apologize! You've gone way above and beyond anything I ever expected.

I made the change you suggested and that works! I can search as specific as I want and every search returns...
39,934
Posted By rwalker
Yeah, I'll tackle this tonight when I come in for...
Yeah, I'll tackle this tonight when I come in for my shift. For now, it's quitting time and I need rest. Thanks again!

---------- Post updated 03-24-16 at 01:07 AM ---------- Previous update was...
39,934
Posted By rwalker
Yeah, exactly like that. At minimum, they need to...
Yeah, exactly like that. At minimum, they need to be able to search the first two digits and at max the whole thing. Searching only the first digit would be the equivalent of not using -v.

All...
39,934
Posted By rwalker
I thought I could get away with not defining...
I thought I could get away with not defining X="*"but that was the first thing I tried and it fails. So, without X="*", I get every single device (including ones I didn't specify) sorted by software...
39,934
Posted By rwalker
I think I did that because I misunderstood how...
I think I did that because I misunderstood how that part works. I did kind of rush through it earlier as my shift was ending. I see what you're saying now, and I'll give it a go when I go back to...
39,934
Posted By rwalker
RudiC, you are just simply awesome! I looked...
RudiC, you are just simply awesome!

I looked up that case-esacstatement to learn a little more about it and how it works. This is exactly what I was looking for!

Here's what I threw together...
39,934
Posted By rwalker
Will do! ---------- Post updated 03-21-16 at...
Will do!

---------- Post updated 03-21-16 at 05:38 AM ---------- Previous update was 03-20-16 at 07:59 AM ----------

I've come up with a couple issues while trying to research and make this...
39,934
Posted By rwalker
Both worked! I decide to opt for the shorter...
Both worked! I decide to opt for the shorter version. I think I tried sub (".*/", at one point, but didn't realize I needed a 2nd or even 3rd item in there for it to work. I was so close!

I can't...
39,934
Posted By rwalker
Came back to playing with this. I found that just...
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...
39,934
Posted By rwalker
-g because it sorts numerically, which I need...
-g because it sorts numerically, which I need based on the software version number. Older software versions need to be at the top of my list, which -g has also accomplished.

If this also works by...
39,934
Posted By rwalker
So, I should have used sort -g instead? I tested...
So, I should have used sort -g instead? I tested with that and it worked too.

I know I can cd in and out as I need to. It's not that big of a deal, it's just something I wanted to accomplish with...
39,934
Posted By rwalker
I used sort -k5 because I need it to sort by the...
I used sort -k5 because I need it to sort by the 5th column from my print $5, which it does. Is there a better way of doing it?

Initially, I was doing cd into the directory and running the...
39,934
Posted By rwalker
I definitely don't need the /show.version to...
I definitely don't need the /show.version to appear. It doesn't hurt anything, I just prefer not to see it.

I don't fully understand what's going on in {sub (/[^\/]* .$/, "", FILENAME), so I don't...
39,934
Posted By rwalker
I apologize, I had assumed FILENAME was something...
I apologize, I had assumed FILENAME was something I could change. I went back through what you suggested before, kept FILENAME, fixed the sub string and everything displayed exactly how I wanted it....
39,934
Posted By rwalker
awk '/JUNOS/ && /boot/ {print devices $5}'...
awk '/JUNOS/ && /boot/ {print devices $5}' *cpe.domain.net/show.version

That gave me the list of software versions.

I see in this '/JUNOS/ && /boot/ how it replaces my grep from my original...
39,934
Posted By rwalker
Alright, that allowed the script to run, however,...
Alright, that allowed the script to run, however, it only gave me a list of the software versions without the device names.
39,934
Posted By rwalker
I tried echo -n but it still gives me the output...
I tried echo -n but it still gives me the output wrong. It puts a lot of the devices and their software version on the same line, but I still get lines where multiple devices show together on one...
Showing results 1 to 25 of 27

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