Nicholas Smith wrote:
I'm still a newbie, so bare with me.

Does sed 's/object_type//' mean "Substitute object_type for nothing?
A quick look at my Linux in a nutshell seems to say that you substite argument 1 for argument 2... and argument 2 is blank.

I don't have Linux in a Nutshell handy, but it's supposed to put 2 (nothing) in the place of 1 (object_type). In other words, the first item is the target, and the second is the replacement. As the man page page for sed puts it:

 s/regexp/replacement/
       Attempt to match regexp against the pattern space. If success‐
       ful, replace that portion matched with replacement...

Also, why does it have to be in single quotes? Would this do nothing?...

sed s/object_type//

Have you tried it? ;) Actually it works fine without the single quotes - until you try a target or replacement with spaces in it...

Cheers,
Vern

-Nick


 > Date: Mon, 1 Dec 2008 08:58:17 -0500
 > From: [EMAIL PROTECTED]
 > To: [email protected]
 > Subject: Re: [fwlug] BASH Script Help
 >
 >
 >
 > Nicholas Smith wrote:
 > > Code:
 > >
> > [EMAIL PROTECTED]:~$ gconftool-2 --search-key object_type | grep menu-object | awk '{print $1}'
 > >
 > > ... and that returned this:
 > > Code:
 > >
 > > /apps/panel/objects/object_0/object_type
 > >
 > > Now, how do I remove the object_type leaving just
 > > "/apps/panel/objects/object_0/" ?
 >
 > Add "| sed 's/object_type//' to the end of your of your command string...
 >
 > > Or is there a smarter way to get to that output?
 >
 > Uh, probably... ;) But it's not coming to me on this Monday morning...
 >
 > Cheers,
 > Vern
 >
 > > -Nick
 > >
 > >
> > ------------------------------------------------------------------------
 > > Color coding for safety: Windows Live Hotmail alerts you to suspicious
 > > email. Sign up today.
> > <http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_safety_112008
 > > >
 > >
 > >
> > ------------------------------------------------------------------------
 > >
 > > _______________________________________________
 > > Fwlug mailing list
 > > [email protected]
 > > http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org
 >
 > --
 > This time for sure!
 > -Bullwinkle J. Moose
 > -----------------------------
 > Vern Ceder, Director of Technology
 > Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804
 > [EMAIL PROTECTED]; 260-436-0746; FAX: 260-436-5137
 >
 > _______________________________________________
 > Fwlug mailing list
 > [email protected]
 > http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org

------------------------------------------------------------------------
Access your email online and on the go with Windows Live Hotmail. Sign up today. <http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_access_112008>


------------------------------------------------------------------------

_______________________________________________
Fwlug mailing list
[email protected]
http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org

--
This time for sure!
   -Bullwinkle J. Moose
-----------------------------
Vern Ceder, Director of Technology
Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804
[EMAIL PROTECTED]; 260-436-0746; FAX: 260-436-5137

_______________________________________________
Fwlug mailing list
[email protected]
http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org

Reply via email to