From owner-freebsd-questions@FreeBSD.ORG Wed Jun 16 13:55:40 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3761C1065673 for ; Wed, 16 Jun 2010 13:55:40 +0000 (UTC) (envelope-from randy.belk@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id EAE288FC13 for ; Wed, 16 Jun 2010 13:55:39 +0000 (UTC) Received: by gxk27 with SMTP id 27so1573062gxk.13 for ; Wed, 16 Jun 2010 06:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=fmciWJXOA6AghVtwxpqqxe7QR3v3KfCN9xqY/vIS+Cc=; b=v7UI8pIeA5c0W3jy1Afs4Pg0icLkUj2hNWFiU0pi0ylpJcA9ruSEEpZEFFgT/vhHtV O/HxpQpI83eQFeszsn4L+g86cZwpiTNQr3DD6oZcf4RYnUUPxkya250TQvi4i9Pe+5OQ EbFo4hSbHF5n63hocTNgu4VRel2d/kiP0p3/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=IT/oVB+HJRAPKcQ+hH7uc5RAX7lkoLxdzmZP6NJTuu7eRe4H3Gi5WfzwTPrz++X3P+ EWocyvy9+newTPVckPbpO8hAbIHnvDqzy2/VknyZfe+D/AHALmccCc7aqcy11uQUO+Rq 5taMWKHoZGxa4po7JPPHjp+cPoo0qlViENoqc= Received: by 10.150.167.5 with SMTP id p5mr10039332ybe.213.1276696539104; Wed, 16 Jun 2010 06:55:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.146.4 with HTTP; Wed, 16 Jun 2010 06:55:09 -0700 (PDT) In-Reply-To: <4C18B276.4080900@comclark.com> References: <4C18B276.4080900@comclark.com> From: Randy Belk Date: Wed, 16 Jun 2010 08:55:09 -0500 Message-ID: To: Aiza Content-Type: text/plain; charset=ISO-8859-1 Cc: "questions@freebsd.org" Subject: Re: .sh and sed 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: Wed, 16 Jun 2010 13:55:40 -0000 You could always use basename for this. "basename /usr/local/bin/bash" will display "bash" On Wed, Jun 16, 2010 at 6:16 AM, Aiza wrote: > Trying to use sed to remove the path from the file name. > Variable has complete path plus the file name > /usr/local/etc/filename > Need variable containing only the file name. > Is the sed utility the best thing to use? > Is there some other utility better suited for this task. > How would sed by coded to do this? > > Thanks for your help in advance. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > -- - Simplicity is the ultimate sophistication. - Leonardo da Vinci - Intelligence is not defined by what you know, It's how you USE it. - People who hate Windows use Linux but people who love UNIX use BSD.