[lug] Letting Bash do the Arithmetic

Kenneth D. Weinert kenw at quarter-flash.com
Mon Apr 14 18:59:22 MDT 2003


Try this:

typeset -i head_lines

((head_lines = 23945837-4926402))

head -n $head_lines some.file

On Mon, Apr 14, 2003 at 06:28:22PM -0600, Peter Hutnick wrote:
> So I'm trying stuff like "head -n ((23945837-4926402)) some.file"  and
> getting "bash: syntax error near unexpected token `('."

-- 
/~\ The ASCII        Ken Weinert   mc at quarter-flash.com 
\ / Ribbon Campaign  303-452-6603 (V) 303-705-4258 (F)
 X  Against HTML     GnuPG: 9274F1CE  GnuPG available at http://www.gnupg.org/
/ \ Email!           1D87 3720 BB77 4489 A928  79D6 F8EC DD76 9274 F1CE
Backups? We don' *NEED* no steenking backups.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20030414/2764883b/attachment.pgp>


More information about the LUG mailing list