/bin/date and coreutils

David Liontooth liontooth at cogweb.net
Fri May 18 08:55:12 PDT 2007


N_Ox wrote:
> Just a side note: as stated in sed(1) and gnused(1) manpages,
> I'm pretty sure sed -E is the same as gnused -r.

Thanks! Don't know how I missed that.

# echo 2007-05-02 | gnused -r
's/([0-9]{4})-([0-9]{2})-([0-9]{2})/\1\/\1-\2/'
2007/2007-05

# echo 2007-05-02 | sed -E 's/([0-9]{4})-([0-9]{2})-([0-9]{2})/\1\/\1-\2/'
2007/2007-05

Dave

>
> N_Ox.
>
> Le 7 mai 07 à 20:52, David Liontooth a écrit :
>
>>
>> In the case of sed, I needed the -r switch and found gsed, providing
>> gnused, in macports, which works great.
>>
>> Dave
>





More information about the macports-users mailing list