From owner-freebsd-questions@FreeBSD.ORG Fri Jul 12 01:19:47 2013 Return-Path: Delivered-To: questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CC669E25 for ; Fri, 12 Jul 2013 01:19:47 +0000 (UTC) (envelope-from fbsd8@a1poweruser.com) Received: from mail-03.name-services.com (mail-03.name-services.com [69.64.155.195]) by mx1.freebsd.org (Postfix) with ESMTP id BB760109F for ; Fri, 12 Jul 2013 01:19:47 +0000 (UTC) Received: from [10.0.10.1] ([173.88.196.224]) by mail-03.name-services.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 11 Jul 2013 18:19:43 -0700 Message-ID: <51DF59B1.4020107@a1poweruser.com> Date: Thu, 11 Jul 2013 21:19:45 -0400 From: Fbsd8 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: questions@FreeBSD.org Subject: jls usage Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Jul 2013 01:19:43.0274 (UTC) FILETIME=[E389B0A0:01CE7E9D] X-Sender: fbsd8@a1poweruser.com X-Authenticated-Sender: fbsd8@a1poweruser.com X-EchoSenderHash: [fbsd8]-[a1poweruser*com] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jul 2013 01:19:47 -0000 In a .sh script I'm trying to get the jid for a single jail using this code jid=`jls -j jailname | cut -f 1- | awk '{print $1}'` The first line output by jls is a title line which the cut command is suppose to cut out so the first field on line 2 gets selected by the awk command. This is not working as I want, I get the first field of the title line. Is the cut command the correct command to us here? This is what the jls command shows # /root >jls -j dir2 JID IP Address Hostname Path 15 10.0.10.24 dir2 /usr/jails/dir2 I am after the number 15 Thanks in advance