[wellylug] yet another simple super basic bash question
Murray Fox
mfox at actrix.co.nz
Wed Dec 22 11:00:59 NZDT 2004
On Wed, 22 Dec 2004 10:57, Mark Signal wrote:
> Hi
>
> I need to reverse a 4 digit number in a bash script
> eg 1234 becomes a variable of 4321
> I suppose I could do it with cut and reassemble the bits in the reverse
> order but there must be a neater way.
>
> any suggestions?
>
> cheers
>
> Mark
Use rev ;
$ echo "1234" |rev
4321
Cheers,
Murray
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20041222/3a256bc8/attachment.pgp
More information about the wellylug
mailing list