From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82132 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.comp.tex.context Subject: Re: Is it possible to set the output file name in the script Date: Fri, 26 Apr 2013 21:49:33 +0200 Message-ID: References: <517AA765.8070406@wxs.nl> <517AB17E.8030104@wxs.nl> <517AB56C.6070907@wxs.nl> 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 1367005783 7634 80.91.229.3 (26 Apr 2013 19:49:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Apr 2013 19:49:43 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 26 21:49:48 2013 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 1UVoeQ-0004Ie-W2 for gctc-ntg-context-518@m.gmane.org; Fri, 26 Apr 2013 21:49:47 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9EEFE101EB; Fri, 26 Apr 2013 21:49:45 +0200 (CEST) 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 8t-ZD7pYh2KT; Fri, 26 Apr 2013 21:49:41 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 7ACFA101E4; Fri, 26 Apr 2013 21:49:41 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8B777101E4 for ; Fri, 26 Apr 2013 21:49:39 +0200 (CEST) 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 QIcOMFrxJqg4 for ; Fri, 26 Apr 2013 21:49:35 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id 4813E101E0 for ; Fri, 26 Apr 2013 21:49:34 +0200 (CEST) Original-Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3QJnXD9012559 for ; Fri, 26 Apr 2013 21:49:34 +0200 Original-Received: by mail-wg0-f43.google.com with SMTP id c11so2388234wgh.10 for ; Fri, 26 Apr 2013 12:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=NoB57tnl1qwJu0AaA2umsgiJoNcwp6EmKYoMmChj7v4=; b=KMmHcxbgAkHwgtWkFT4F8teC+QA4kCiEM4j7r41Gks1WNffjpbWsU0lditcupjmDNg fdoNMDfjKdAfBRuVSgnyAby8s4GZ8MOHbURW7clLIfefBjUp4qnlcIQPc22Jbw//q0Dj IQ87sEyVMWuMfnbSBDKvwPuG8sASXncu7JO4YrDiRu2ryYz7WhadbywCCNsCKNHRmx9S jbXyWQEnXF7PZtT/dljXf5/SyiMtlcizosNk2gDR9iLxhdKUWvhhIje6UJk+AIchh4Gc DVBdlhNsQp3nHAPRnEjO7yLcwOjz7yJR/Y3Mw9zaxaWf84xpz/YL9iLKlrz73Bslun6D hQIg== X-Received: by 10.180.189.205 with SMTP id gk13mr6122612wic.25.1367005773810; Fri, 26 Apr 2013 12:49:33 -0700 (PDT) Original-Received: by 10.194.109.233 with HTTP; Fri, 26 Apr 2013 12:49:33 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c00::22b; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0WJsHNyoF - 307f7f1c934a - 20130426 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:82132 Archived-At: 2013/4/26 Cecil Westerhof : > 2013/4/26 Hans Hagen : >> On 4/26/2013 7:01 PM, Cecil Westerhof wrote: >>> >>> 2013/4/26 Hans Hagen : >>>> >>>> On 4/26/2013 6:50 PM, Cecil Westerhof wrote: >>>>> >>>>> >>>>> 2013/4/26 Hans Hagen : >>>>>> >>>>>> >>>>>> On 4/26/2013 5:34 PM, Cecil Westerhof wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> I am using a command line parameter to change the generated output. Is >>>>>>> it also possible to set the output file name depending on the >>>>>>> parameter? >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> --result=somename >>>>> >>>>> >>>>> >>>>> That is on the command line. Then you need to give two parameters. Not >>>>> a very big problem, but I would prefer one parameter. I like DRY. Less >>>>> that can go wrong. >>>> >>>> >>>> >>>> not possible but you can access the outputfilename at the tex and lua end >>> >>> >>> What do mean with that? >> >> >> just grep for outputfile in lua and mkiv files > > I have now (I need to use jobfilename, because I get an error when I > use outputfilename): > \def\outputfilename{\jobfilename -\getvariable{meta}{type}} > \def\outputfilenametwo{\jobfilename -\getvariable{meta}{type}} > > When displaying outputfilenametwo I see that it is filled with the > correct value, but the output is still written to the same file. The following script does what I want: #!/usr/bin/env bash set -o errexit set -o nounset declare -r DEFAULT=cecil declare -r DIR=${HOME}/Documenten/CV declare -r FILE=CV-Cecil-Westerhof declare -r SCRIPTNAME=$(basename ${0}) declare RESULT declare TYPE if [[ ${#} -ge 1 ]] ; then TYPE=${1}; shift else TYPE=${DEFAULT} fi readonly TYPE if [[ ${#} -ne 0 ]] ; then echo "USAGE: ${SCRIPTNAME} [TYPE]" exit 1 fi cd ${DIR} RESULT=${FILE} if [[ ${TYPE} != ${DEFAULT} ]] ; then RESULT+=-${TYPE} fi readonly RESULT context --CVType=${TYPE} --result=${RESULT} CV-Cecil-Westerhof There is only one problem. If I first generate the default one and after that a specific one, the default one does not exist anymore. I suppose that when --result is used, first the pdf with the same name as the tex file is generated and then moved. A little nuisance, but I can live with it. -- Cecil Westerhof ___________________________________________________________________________________ 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 ___________________________________________________________________________________