From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82136 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 22:07:26 +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 1367006851 18473 80.91.229.3 (26 Apr 2013 20:07:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Apr 2013 20:07:31 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 26 22:07:36 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 1UVovc-0006la-4N for gctc-ntg-context-518@m.gmane.org; Fri, 26 Apr 2013 22:07:32 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A9BC1101F8; Fri, 26 Apr 2013 22:07:31 +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 dwqrHEi++m+g; Fri, 26 Apr 2013 22:07:30 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 1F134101E4; Fri, 26 Apr 2013 22:07:30 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 81B92101E4 for ; Fri, 26 Apr 2013 22:07:28 +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 3Cn5Yfwjxz93 for ; Fri, 26 Apr 2013 22:07:27 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 75471101E0 for ; Fri, 26 Apr 2013 22:07:27 +0200 (CEST) Original-Received: from mail-we0-x233.google.com (mail-we0-x233.google.com [IPv6:2a00:1450:400c:c03::233]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3QK7Qx4022866 for ; Fri, 26 Apr 2013 22:07:26 +0200 Original-Received: by mail-we0-f179.google.com with SMTP id u7so207989wey.38 for ; Fri, 26 Apr 2013 13:07:26 -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=yLXls5BmoUjhevtmV6xMtPdeR5uPN5JTQtWHqFvGqqU=; b=c4jykI0o3bHTxIo0LRmMPiaUEeBTtE8bMOCAH8fh6JPcxGis8NAhALqnlDj/tCEK/e rtjo5BnXNW8SDkSzyKH5RbaIp1lfdgpM0eNLHmTjhcaHAkKQzDVY7OUvzLqxW9szuE2c QoQlKMaCy7xWBy52vdZ/xW/N3gImUYafrbUTmm0ohcTDAOsobhyqBbyLWWjyydLuUWe7 Z/70rXdCm7c31fn3IMHbQ92DE/3NFPMb6KHhV7UMSmC6SUBWSD5FvOn4jhliPgNUerbb qaWEURZiteGGxZBIX8tpniAG7imRWZJAkmCr0V7u+GIH799y6vAblqs2rMVCF7beptX5 L1Aw== X-Received: by 10.180.108.106 with SMTP id hj10mr6342878wib.0.1367006846323; Fri, 26 Apr 2013 13:07:26 -0700 (PDT) Original-Received: by 10.194.109.233 with HTTP; Fri, 26 Apr 2013 13:07:26 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c03::233; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06JsI7qcf - 9f47d7949dc0 - 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:82136 Archived-At: 2013/4/26 Cecil Westerhof : > 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. That can be solved by renaming the tex-file to CV.tex. The script is now: #!/usr/bin/env bash set -o errexit set -o nounset declare -r DEFAULT=cecil declare -r DIR=${HOME}/Documenten/CV declare -r FILE=CV declare -r SCRIPTNAME=$(basename ${0}) declare RESULT=CV-Cecil-Westerhof 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} if [[ ${TYPE} != ${DEFAULT} ]] ; then RESULT+=-${TYPE} fi readonly RESULT context --CVType=${TYPE} --result=${RESULT} ${FILE} -- 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 ___________________________________________________________________________________