From owner-freebsd-i386@FreeBSD.ORG Wed Sep 3 11:30:01 2008 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9002A106566B for ; Wed, 3 Sep 2008 11:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 298BD8FC25 for ; Wed, 3 Sep 2008 11:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m83BU1nE080441 for ; Wed, 3 Sep 2008 11:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m83BU1V9080440; Wed, 3 Sep 2008 11:30:01 GMT (envelope-from gnats) Resent-Date: Wed, 3 Sep 2008 11:30:01 GMT Resent-Message-Id: <200809031130.m83BU1V9080440@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Anarchist Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6154E106564A for ; Wed, 3 Sep 2008 11:25:33 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 4C68B8FC16 for ; Wed, 3 Sep 2008 11:25:33 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m83BPWQU097464 for ; Wed, 3 Sep 2008 11:25:32 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m83BPWiQ097463; Wed, 3 Sep 2008 11:25:32 GMT (envelope-from nobody) Message-Id: <200809031125.m83BPWiQ097463@www.freebsd.org> Date: Wed, 3 Sep 2008 11:25:32 GMT From: Anarchist To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: i386/127063: shell: $RANDOM doesn't works in scripts X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2008 11:30:01 -0000 >Number: 127063 >Category: i386 >Synopsis: shell: $RANDOM doesn't works in scripts >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Sep 03 11:30:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Anarchist >Release: FreeBSD 6.3-RELEASE #0 >Organization: nixp.ru >Environment: FreeBSD gw-1.caotus.ru 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Wed Apr 16 10:24:30 MSD 2008 root@gw-1.caotus.ru:/usr/src/sys/i386/compile/GW-1_KERNEL i386 also seen on FreeBSD mx4.elpay.ru 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: # pkg_info | grep bash bash-3.2.33 The GNU Project's Bourne Again SHell and # pkg_info | grep bash bash-3.2.25 The GNU Project's Bourne Again SHell >How-To-Repeat: Executing "expr $RANDOM % 4" in command line does what it is to do generating random numbers from 0 to 3. When I try to put generating of random numbers in a script like: #!/usr/local/bin/bash expr $RANDOM % 4 exit 0 or #!/bin/sh expr $RANDOM % 4 exit 0 I get the syntax error: "expr: syntax error" Trying to execute both the command and the script on my Linux workstation gives normal result. >Fix: Unknown >Release-Note: >Audit-Trail: >Unformatted: