From owner-freebsd-questions@FreeBSD.ORG Sat Jul 10 11:43:19 2010 Return-Path: Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAE24106564A for ; Sat, 10 Jul 2010 11:43:19 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 624678FC21 for ; Sat, 10 Jul 2010 11:43:19 +0000 (UTC) Received: by wyb34 with SMTP id 34so2732040wyb.13 for ; Sat, 10 Jul 2010 04:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to:date :message-id:subject:from:to:cc:content-type; bh=HtHopUZI3bZY6rbH7I67wV6szf4IQmC0ybzTSQwWHGw=; b=MaRqxGuA5AaMja148FRQZyJnE1bqWP9zoh3BJReMU1LjQKuAap+HGgNMl/v1Yu6SYz csIh5rlC2nsBDqdyh5pBaH3aGTmQ+U0TFor9t6t1g9dduJw00MoQRiV0zHsWJlqoh7JQ FiXWc6AtV10BAXlsrCKJVnJ7cKYntPxMR4+Q8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:cc :content-type; b=Gt8jncGs/3l8yITGbx8u4lIOBNqCAaUSi0wjUJPVX/Q7W9sCmc8KVeBSblH3smrR0A pxIxmcQr/z1Z6BpsXJCi4ffnCPx2sIJBmqjKVHDSPUOq72TpCwBOf/d7yZGUx3kJ6gTE UqgnmJTsysNt1TRN328fSh84KtNrE8wFNdf+M= MIME-Version: 1.0 Received: by 10.216.68.142 with SMTP id l14mr942658wed.67.1278762193800; Sat, 10 Jul 2010 04:43:13 -0700 (PDT) Received: by 10.216.171.10 with HTTP; Sat, 10 Jul 2010 04:43:13 -0700 (PDT) Date: Sat, 10 Jul 2010 11:43:13 +0000 Message-ID: From: "b. f." To: freebsd-questions@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Aiza , Polytropon Subject: Re: how to setenv using Bourne .sh X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf1783@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2010 11:43:19 -0000 Polytropon wrote: On Sat, 10 Jul 2010 10:53:17 +0800, Aiza wrote: >> Trying the set the pkg_add environment variable PKGDIR using this >> >> >> setenv PKGDIR="/usr/packages" and get this error message >> setenv: Syntax Error. > >Of course. The sh shell doesn't have setenv. It looks like he is actually using csh, because in the Bourne shell issuing that command usually yields "setenv: not found". His problem is that, unlike "export", setenv doesn't take an "=" between the variable and the value to be assigned to it. See csh(1). >> man setenv is useless. > >The manual entry of setenv can be found in "man csh". :-) When you are directed to builtin(1), it usually means that you should refer to the manpage(s) of the shell that you are using for the information that you need. >> The question is how do I set a environment variable using the default >> freebsd shell? > >You mean: FreeBSD's default scripting shell. :-) He could mean the default interactive shell, which could be something other than sh(1), despite the title of his message. As an alternative to "export" or "setenv", he could instead use env(1) in some instances. b.