Nicholas, Here is a link to advanced bash scripting that explain how to parse strings in bash: http://www.museum.state.il.us/ismdepts/library/linuxguides/abs-guide/parameter-substitution.html
Your original questions would be handled like this:
bash.code.start
parm=/apps/panel/objects/object_0/object_type ;
echo "${parm%%/object_type}"
bash.code.end
returns => /apps/panel/objects/object_0
This is the magic -- ${parm%%/object_type}
As for the smarter way? I need to know more about what your trying to do
and why your using gconf to do it?
James,
ps. how about writing a c program with gtk to meet this need? I could
help you.
On Mon, 2008-12-01 at 08:24 -0500, Nicholas Smith wrote:
> I am writing a quick BASH script with a zenity GUI... one thing I
> wanted to add is the option to change the main-menu icon. In the
> gconf-editor you would change
>
> Code:
> /apps/panel/objects/*/use_custom_icon
> to true, and
> Code:
> /apps/panel/objects/*/custom_icon
> to the location of the new icon.
>
> My problem... The "*" could be different for each user.... it may be
> object_1, object_3, etc.
>
> I need the "menu-object" one, so I decided to figure it out with this
> command:
>
> 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/" ?
>
>
> Or is there a smarter way to get to that output?
>
> -Nick
>
>
>
> ______________________________________________________________________
> Color coding for safety: Windows Live Hotmail alerts you to suspicious
> email. Sign up today.
> _______________________________________________
> Fwlug mailing list
> [email protected]
> http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Fwlug mailing list [email protected] http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org
