Link to home
Start Free TrialLog in
Avatar of Owen_Parker
Owen_Parker

asked on

Looking for a linux command line solution

This is child-like I am sure, as all things are once you know the answer.  I have never needed to do much on the command line besides the usual.  I am curious if there is a way to do this simple task without writing an actual script...

I do this:

grep 'BOOTPROTO' /etc/sysconfig/network/ifcfg-eth0

Open in new window


I get this:

BOOTPROTO='static'

Open in new window


I need this:

static

Open in new window


I thought awk would be easy, but the lack of spaces in the result shut that idea down.  I have no idea how to trim this out via command line.  Maybe there is a command to return only that between the single quotes or some such.  Maybe a regular expression?  Not my area.  Hoping this can be my 'one new thing' for today...

O
ASKER CERTIFIED SOLUTION
Avatar of Dave Gould
Dave Gould

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Owen_Parker
Owen_Parker

ASKER

Splendid  trappa01!  The explanation is much more valuable than the answer!  I have never used awk per se, but have seen it used many times by my resident engineer/Linux guru I usually push this stuff to.  I'll review better the options now that i know better the possibilities.
Perfectly explained final answer...