From owner-freebsd-questions@FreeBSD.ORG Wed Jul 21 15:07:04 2010 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 B5BD7106566B for ; Wed, 21 Jul 2010 15:07:04 +0000 (UTC) (envelope-from jimbobpalmer@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 5080D8FC0C for ; Wed, 21 Jul 2010 15:07:03 +0000 (UTC) Received: by wwe15 with SMTP id 15so2037252wwe.31 for ; Wed, 21 Jul 2010 08:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=l8olg2F+8cIFSlu/9goYqR4XX7YF0nPQmVb9tsNVcl8=; b=Pe4bBDttcMhDCUROf1fCovO2NdbUALkZ8Y7biAB6imGyE9uYv53IDnO92qxtNxdz+f JV7m7wh3AKV4675/NBw2Ff4DdGjiZL7DrxN5LqEMQHo2Z9bz5OZGOXyPcelvX+FgWsSG s0rQZiflPWbtITfp6fsO/2DsoHV3M8ctbPHzY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=MFNsRjb1FKtlyLy6GBtsyGEwCQ3750y0JNLmc9EwcZVXNSjktmcyNE+hgLwL24e7wm qZU2oJW0NsbhvTQBl5adpBWBEfawu7LhQL0ZKNQ+B4slR20QwcVt/AdAZp73M88TfYcf xBgDzyQBHLgSaQAeKOLvHHzLW4H9vCRdo9C04= MIME-Version: 1.0 Received: by 10.227.148.2 with SMTP id n2mr217270wbv.216.1279723237513; Wed, 21 Jul 2010 07:40:37 -0700 (PDT) Received: by 10.216.67.147 with HTTP; Wed, 21 Jul 2010 07:40:37 -0700 (PDT) Date: Wed, 21 Jul 2010 16:40:37 +0200 Message-ID: From: jimbob palmer To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Bash logging: two questions 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, 21 Jul 2010 15:07:04 -0000 Hello, I would like to run a bash script but to log output and exit codes. Essentially I would like to run the script with bash -x, but for that output to the log to go to a file, and the normal output as from running a normal script to go to the terminal. That's my first question :) My second question is about history. Bash has a -h option to remember the location of commands as they are looked up. Is it possible for this to be recorded in the history? e.g. if I run ls, it would record /bin/ls to the bash history file. Many thanks. JB