RE: Recommended way to truncate a shell variable value in autoconf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Date: Fri, 21 Feb 2014 16:57:28 -0700
> From: eblake@xxxxxxxxxx
> To: dale.visser@xxxxxxxx; autoconf@xxxxxxx
> Subject: Re: Recommended way to truncate a shell variable value in autoconf
> 
> 'string : regexp' is portable.  'match string regexp' is not.  For
> example this use of expr is already present in pretty much any configure
> file generated by modern autoconf:
> 
>     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'

Good. I think I have settled on this, but will go back to the expr solution if you think that would be better:

X=`echo "$X" | sed 's/ .*// ' | sed 's/,.*//'`

By the way, thank you for all your help. :-)
 		 	   		  
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux