From owner-freebsd-questions Wed Feb 12 07:21:42 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id HAA03658 for questions-outgoing; Wed, 12 Feb 1997 07:21:42 -0800 (PST) Received: from mail.EUnet.hu (www.eunet.hu [193.225.28.100]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA03645 for ; Wed, 12 Feb 1997 07:21:35 -0800 (PST) Received: by mail.EUnet.hu, id QAA27504; Wed, 12 Feb 1997 16:21:19 +0100 Received: (from zgabor@localhost) by CoDe.hu (8.7.5/8.7.3) id RAA00227; Mon, 10 Feb 1997 17:04:39 +0100 (MET) From: Zahemszky Gabor Message-Id: <199702101604.RAA00227@CoDe.hu> Subject: Re: Stupid vi question To: freebsd-questions@freebsd.org (FreeBSD questions) Date: Mon, 10 Feb 1997 17:04:38 +0100 (MET) Cc: handy@sag.space.lockheed.com In-Reply-To: from "Brian N. Handy" at "Feb 9, 97 10:08:45 am" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Hey, > > So...here's something that's annoyed me for a long time, and now someone > else has asked me the same question. > > When you're in vi...if you want to wrap a paragraph of text, you might use > a command like: > > !}fmt > > Now, on every machine other than mine, this works. On my FreeBSD box, I > get: > stty: stdin isn't a terminal > > (Though the wrap works fine and there are no other problems.) > > What's going on here? How do I fix this? Well, this means, that you have such a shell, that has a ``second'' initialisation file. (Eg: csh has .cshrc, sh/ksh has the file named in the ENV variable, bash has Idontknowthename, etc.) In that file, you have an stty command. You have to ``ifdef'' the stty command, like this: sh/ksh/bash: if "$-" in *i*) # it is an interactive shell stty ... any command, which hasn't any meaning in non-interactive shells ;; *) # it is a non-interactive shell any command, which has any meaning in non-interactive shells ;; esac csh/tcsh: if ( $?prompt ) then # interactive shell stty ... any command, which hasn't any meaning in non-interactive shells else # non interactive shell any command, which has any meaning in non-interactive shells endif That's it. Gabor