Re: OT: bashfråga

Michael Kjörling <[email protected]>
Newsgroups gmane.linux.debian.user.swedish
Message-ID <[email protected]>
On 30 Mar 2015 15:09 +0100, from [email protected] (Peter Krefting):
> Fast det ger tre binärer (date, xargs och echo), då kanske Perl kan
> vara snabbare:
> 
>   perl -e 'use POSIX;print strftime("%Y%m%d_%H%M%S",localtime)'

Om du tror att svaret är "Perl är snabbare" så är det mest troligt fel
på frågan. :-)

Då vinner nog min lösning med printf, endast en relativt lättviktig
binär (date; _någon_ variant på det temat är nog svår att undvika) som
ska startas, och printf är inbyggt i bash.

-- 
Michael Kjörling • https://michael.kjorling.se • [email protected]
OpenPGP B501AC6429EF4514 https://michael.kjorling.se/public-keys/pgp
                 “People who think they know everything really annoy
                 those of us who know we don’t.” (Bjarne Stroustrup)


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: https://lists.debian.org/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.