From owner-freebsd-questions@FreeBSD.ORG Wed Jun 16 11:16:15 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 3BE91106566B for ; Wed, 16 Jun 2010 11:16:15 +0000 (UTC) (envelope-from aiza21@comclark.com) Received: from avmxsmtp3.comclark.com (avmxsmtp3.comclark.com [202.69.191.117]) by mx1.freebsd.org (Postfix) with ESMTP id C49508FC17 for ; Wed, 16 Jun 2010 11:16:14 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgQaAMdPGEzKRa1bPGdsb2JhbAAHh2iXFQEBAQE1J75dhRoEg1A X-IronPort-AV: E=Sophos;i="4.53,426,1272816000"; d="scan'208";a="4060390" Received: from unknown (HELO [10.0.10.3]) ([202.69.173.91]) by avmxsmtp3.comclark.com with ESMTP; 16 Jun 2010 19:16:09 +0800 Message-ID: <4C18B276.4080900@comclark.com> Date: Wed, 16 Jun 2010 19:16:06 +0800 From: Aiza User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: "questions@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: .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 11:16:15 -0000 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.