From owner-freebsd-questions@FreeBSD.ORG Wed Oct 8 07:00:41 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1F331065697 for ; Wed, 8 Oct 2008 07:00:41 +0000 (UTC) (envelope-from artis.caune@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by mx1.freebsd.org (Postfix) with ESMTP id 9BDDD8FC1A for ; Wed, 8 Oct 2008 07:00:41 +0000 (UTC) (envelope-from artis.caune@gmail.com) Received: by an-out-0708.google.com with SMTP id b33so207307ana.13 for ; Wed, 08 Oct 2008 00:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UH+FJ2pP6gGyHKe3D6H4MEEaSt5WYLVr15dHhVAUWSQ=; b=MCIpTLCmfOZdO4XtXOPqGqNckPv5hTSCnnfoBSpNC70coDoiitTj/Jrxa9xiFjR4pJ 90xXTjvWBaEPUm8jGhETjbW3+tpDmQHcp0iGI0T3AuoHq4QgiWEnLX9QQZ82FJ2xhMu7 a9+4qIqRgdhGBimHQdwzcaI7pxDehgbqyebG8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=GuaWkNq41VoDulBSu7Mn3qOY5UmQXwQ/QOc0KbQhhpJiS0Uwmd+Y06ZI1oMvNt3Wo5 RDmiU/N3rxvacwyWc8GzA4cei3Xxlpa0q1js2qaD9WPku9NSAEAUlCY/HwQQRURuaqoy IZt2nJQd63ZOdpki9hlhf4eGOiqM/+DwaZ5b0= Received: by 10.100.166.10 with SMTP id o10mr1021127ane.126.1223449240639; Wed, 08 Oct 2008 00:00:40 -0700 (PDT) Received: by 10.100.253.17 with HTTP; Wed, 8 Oct 2008 00:00:40 -0700 (PDT) Message-ID: <9e20d71e0810080000g7720cba3je2d734fd30c01e45@mail.gmail.com> Date: Wed, 8 Oct 2008 10:00:40 +0300 From: "Artis Caune" To: "Kalpin Erlangga Silaen" In-Reply-To: <48EC410C.2030707@muliahost.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48EC410C.2030707@muliahost.com> Cc: freebsd-questions@freebsd.org Subject: Re: bash script on FreeBSD 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, 08 Oct 2008 07:00:42 -0000 On Wed, Oct 8, 2008 at 8:11 AM, Kalpin Erlangga Silaen wrote: > I am going to extract field username and UID from /etc/passwd and passed > into some scripts. Let say I got line > > admin 100 > admin2 200 > admin3 300 > admin4 400 > > and then I want to echoing into screen: > > admin has uid 100 > admin2 has uid 200 > admin3 has uid 300 > admin4 has uid 400 > > How do I make this with bash script? # echo $line |awk '{ print $1 " has uid " $2 }' -- regards, Artis Caune <----. CCNA | BSDA <----|==================== <----' didii FreeBSD