Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jul 2013 21:19:45 -0400
From:      Fbsd8 <fbsd8@a1poweruser.com>
To:        questions@FreeBSD.org
Subject:   jls usage
Message-ID:  <51DF59B1.4020107@a1poweruser.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51DF59B1.4020107>