From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/49404 Path: news.gmane.org!not-for-mail From: Bill Long Newsgroups: gmane.comp.tex.context Subject: how to use attachment file as a script argument Date: Tue, 14 Apr 2009 17:57:19 +0800 Message-ID: <20090414095719.GA7582@localhost.localdomain> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1239703213 26588 80.91.229.12 (14 Apr 2009 10:00:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Apr 2009 10:00:13 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 14 12:01:32 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LtfSD-0006Lv-VT for gctc-ntg-context-518@m.gmane.org; Tue, 14 Apr 2009 12:01:22 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 833091FB5B; Tue, 14 Apr 2009 11:59:55 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25520-06; Tue, 14 Apr 2009 11:58:33 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A0CD31FADF; Tue, 14 Apr 2009 11:58:33 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BD3FE1FADF for ; Tue, 14 Apr 2009 11:58:31 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13708-01 for ; Tue, 14 Apr 2009 11:57:31 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by ronja.ntg.nl (Postfix) with ESMTP id 165E31FADC for ; Tue, 14 Apr 2009 11:57:28 +0200 (CEST) Original-Received: from smtp.sohu.com (websmtp.sohu.com [61.135.132.183] (may be forged)) by filter2-ams.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n3E9vNmJ027656 for ; Tue, 14 Apr 2009 11:57:27 +0200 Original-Received: from localhost (unknown [116.231.97.42]) by smtp.sohu.com (Postfix) with ESMTP id B127727E7AD for ; Tue, 14 Apr 2009 17:57:18 +0800 (CST) Mail-Followup-To: ntg-context@ntg.nl Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=61.135.132.183; country=CN; region=22; city=Beijing; latitude=39.9289; longitude=116.3883; http://maps.google.com/maps?q=39.9289,116.3883&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 208052179 - f4b69b2b9227 - 20090414 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:49404 Archived-At: based on the example of use mplayer play the movie, I write down sthing like >\defineprogram[sample.data][sample.data.sh] >\goto{\externalfigure[sample.data][width=0.48\textwidth]}[program(sample.data{})] and the content of sample.data.sh is >#!/bin/bash > FILE=$(basename "$0"); gnome-terminal -e "cat ${FILE/.sh/}" it does work, but I wanna know if there are better way to make this. as this way has some obvious problem: 1. if I send this pdf file to other guy, the script won't execute, as it can't find out the sample.data file. same thing will happen if I move my sample.data to other directory. 2. it's take too much effort if I have lots of file to analysis, I have to write lots of file like sample.data1.sh, sample.data2.sh... with same content, soft link maybe a solution, but I hope there are more easy solution. ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________