From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14682 invoked by alias); 11 Sep 2014 21:36:16 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19064 Received: (qmail 20337 invoked from network); 11 Sep 2014 21:36:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Date: Thu, 11 Sep 2014 22:36:08 +0100 From: Dominik Vogt To: Zsh Users Subject: Determining the length of "long"? Message-ID: <20140911213608.GA1029@gmx.de> Reply-To: dominik.vogt@gmx.de Mail-Followup-To: Zsh Users MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:zEt5NhrEt2yAh3gb8Tf9gFo2MevnH3MtSMH9SIrdmz/o1/5WoYv OpTO2Yr5Iwk4somserwRMlh+feszWaqiZ7+AHBzZMxn0jURInBq1XAFYkbhgo0IsGM541yW f0wisLXIDlc1gFx9rTp3BiX2lJWWeGEAxJEnGno5Yn+jTt/t7+5JVskBOk9QvI1iLYBdJDR VjKD6soA/Eq9V64buWKOg== X-UI-Out-Filterresults: notjunk:1; Is there a way to determine the length of the C type long from inside a zsh script (without using external programs, of course). As an alternative, is there a direct way to print out a "long" integer value as binary bytes in host byte order? I.e. given a value, say 0x12345, I need to print that as \\x00\\x01\\x23\\x45 on a 32 bit platform, and as \\x00\\x00\\x00\\x00\\x00\\x01\\x23\\x45 on a 64 bit platform (possibly in reverse byte order, depending on the hardware). Ciao Dominik ^_^ ^_^ -- Dominik Vogt