From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79394 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: Dash equivalent of $BASH_SOURCE (for setuptex) Date: Wed, 21 Nov 2012 12:56:54 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1353499021 19208 80.91.229.3 (21 Nov 2012 11:57:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2012 11:57:01 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Nov 21 12:57:12 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tb8vX-0005U8-T3 for gctc-ntg-context-518@m.gmane.org; Wed, 21 Nov 2012 12:57:12 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 417A51035E; Wed, 21 Nov 2012 12:57:01 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4LRe8k0BMUda; Wed, 21 Nov 2012 12:56:59 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 94D3910345; Wed, 21 Nov 2012 12:56:59 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 90FED10345 for ; Wed, 21 Nov 2012 12:56:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IGoTceC+MoOn for ; Wed, 21 Nov 2012 12:56:56 +0100 (CET) Original-Received: from filter3-utr.mf.surf.net (filter3-utr.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id DC6A010339 for ; Wed, 21 Nov 2012 12:56:56 +0100 (CET) Original-Received: from mail-qa0-f48.google.com (mail-qa0-f48.google.com [209.85.216.48]) by filter3-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qALButwq007869 for ; Wed, 21 Nov 2012 12:56:56 +0100 Original-Received: by mail-qa0-f48.google.com with SMTP id s11so1760562qaa.14 for ; Wed, 21 Nov 2012 03:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=K26VmKSq5vFmkdq/nTrcVQbV5tTt+NeXUJtpzIEoRn0=; b=yogUdobuUD35Oa72UhBdrjQQEVemyGDiXM22BXAg4t+U2hqLJ0dqRFgfEj8zY2giBv e9RU10W+2jV5lww7yjbuxv/k4k4o5bAQWKP6wdlLc6c6ndxBadd4JT6UbpHIDwMxzWsD sPabtK3Bq/k2kSGx4HaKIhlw2DL786RPSHpdhLYABgXwWyHpHQ+cuqzdte1eJKNmXJjC +9pQhwCmS+65+6YhtrwSTX6iStr9cbeFAlSpKG3FIqsi5tGjcg6uUloKdTWDTAArtVgk zBVEiSAN8nqryDGDa/5ITavXGFmPZJr7wMmqZqRkmQAQhUrIYCyVzgHqc9nqP/35Ucrk K4Gg== Original-Received: by 10.49.95.73 with SMTP id di9mr20494115qeb.37.1353499014972; Wed, 21 Nov 2012 03:56:54 -0800 (PST) Original-Received: by 10.49.61.36 with HTTP; Wed, 21 Nov 2012 03:56:54 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.216.48; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08IqbUTO1 - 2567583e96a7 - 20121121 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79394 Archived-At: Hi everyone, Hans wrote me the following, but I'm unable to figure it out myself. The script "setuptex" (which is in fact not urgently needed as one can just as well export the right path, but it comes in handy) can be used in two ways: (a) . /path/to/context/tex/setuptex (b) . /path/to/context/tex/setuptex /path/to/context/tex The first approach only works if the shell interpreting setuptex knows where the sourced script is located. Currently the script uses the following code and works in Bash, KSH (and maybe some other shells as well, but I'm not sure which ones). if [ z"$BASH_SOURCE" != z ]; then SCRIPTPATH="$BASH_SOURCE" elif [ z"$KSH_VERSION" != z ]; then SCRIPTPATH="${.sh.file}" else SCRIPTPATH="$0" fi Hans had problems with Dash, however, I have no clue how to enable (a) in Dash. The (b) approach always works though, so in the worst case the answer to Hans would be "provide the path to your tex root, or write your own script with hardcoded path ;)", but if anyone has any clue if finding path to the executed script is possible in Dash or in any other POSIX-compatible way, please let me know. Mojca On Mon, Nov 19, 2012 at 10:31 AM, Hans Hagen wrote: > Hi Mojca, > > One of the things you need to look into is the first-setup and setup tex > scripts (just look at the dash issues thread) .. i have the impression that > the setuptex script doesn't find its root (own) under dash because it has > different $0 handling (dash is the debian variant of bash, so we're talking > of debian installations) > > Hans ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________