From owner-freebsd-questions@FreeBSD.ORG Fri Apr 13 06:34:00 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 739DC16A400 for ; Fri, 13 Apr 2007 06:34:00 +0000 (UTC) (envelope-from asanjuan@bolsabilbao.es) Received: from correo-1.bolsabilbao.es (correo-1.bolsabilbao.es [212.8.77.215]) by mx1.freebsd.org (Postfix) with ESMTP id F36BF13C484 for ; Fri, 13 Apr 2007 06:33:59 +0000 (UTC) (envelope-from asanjuan@bolsabilbao.es) Received: from correo_6.bolsabilbao.es ([10.33.5.206]) by correo-1.bolsabilbao.es with Microsoft SMTPSVC(6.0.3790.3959); Fri, 13 Apr 2007 08:33:58 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3959 Date: Fri, 13 Apr 2007 08:33:39 +0200 Message-ID: <33E0F3313625E543ACCC41AE2DFD5EF5024308@BB06.bolsabilbao.local> In-Reply-To: <461E668B.4090401@voidcaptain.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Shell scripting: Absolute path name of a file given as parameter Thread-Index: Acd9JKyzoqBoKTCaRaio07QlqguEMwAcNo1A From: "Aitor San Juan" To: X-OriginalArrivalTime: 13 Apr 2007 06:33:58.0593 (UTC) FILETIME=[B7858B10:01C77D95] Importance: normal X-ExchangeSecure-AntiSpam: valid(0) Priority: normal Subject: RE: Shell scripting: Absolute path name of a file given as parameter X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2007 06:34:00 -0000 Thanks a lot to all who replied. Aitor. -----Mensaje original----- De: Pete Slagle [mailto:freebsd-questions@voidcaptain.com] Enviado el: jueves, 12 de abril de 2007 19:04 Para: freebsd-questions@freebsd.org Asunto: Re: Shell scripting: Absolute path name of a file given as parameter Aitor San Juan wrote: > I have developed a shell script that, among other things, shows the = filename > that was specified as a parameter. >=20 > However, when I invoke the script and the file is located in the = current working > directory, it just shows: ./my_input_filename >=20 > I'd like the script to show the full path name of the input file. I = wonder > whether there is or not an equivalent to %~f1 (Windows Batch file = programming). > This parameter extension expands parameter %1 ($1 in shell scripting = jargon) to a > Fully qualified path name. man (1) realpath For example: #!/bin/sh echo The full path of the file name is $(realpath $1) ************ LEGEZKO OHARRA / AVISO LEGAL / LEGAL ADVICE *************=20 Mezu honek isilpeko informazioa gorde dezake, edo jabea duena, edota = legez babestuta dagoena. Zuri zuzendua ez bada, bidali duenari esan eta = ezabatu, inori berbidali edo gorde gabe, legeak debekatzen duelako = mezuak erabiltzea baimenik gabe.=20 -------------------------------------------------------------------------= - Este mensaje puede contener informaci=F3n confidencial, en propiedad o = legalmente protegida. Si usted no es el destinatario, le rogamos lo = comunique al remitente y proceda a borrarlo, sin reenviarlo ni = conservarlo, ya que su uso no autorizado est=E1 prohibido legalmente. -------------------------------------------------------------------------= - This message may contain confidential, proprietary or legally privileged = information. If you are not the intended recipient of this message, = please notify it to the sender and delete without resending or backing = it, as it is legally prohibited. *************************************************************************= *