From owner-freebsd-questions Fri Mar 24 7:29:48 2000 Delivered-To: freebsd-questions@freebsd.org Received: from probity.mcc.ac.uk (probity.mcc.ac.uk [130.88.200.94]) by hub.freebsd.org (Postfix) with ESMTP id 4ECB237B72F for ; Fri, 24 Mar 2000 07:29:40 -0800 (PST) (envelope-from jcm@dogma.freebsd-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97]) by probity.mcc.ac.uk with esmtp (Exim 1.92 #3) for questions@freebsd.org id 12YW1q-0003Fl-00; Fri, 24 Mar 2000 15:29:38 +0000 Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.9.3/8.9.3) id PAA89672 for questions@freebsd.org; Fri, 24 Mar 2000 15:29:38 GMT (envelope-from jcm) Date: Fri, 24 Mar 2000 15:29:37 +0000 From: J McKitrick To: questions@freebsd.org Subject: script to change config files Message-ID: <20000324152937.B89615@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alright, i am very proud of myself for RTFMing and WTFP myself. (Writing The Fine Program). But i would like to know if there is a better way, and oif someone could give me a clue. I am a total neophyte at script programming, but it's only a matter of time and practice. Here's what i wanted to do: when i log into my shell account from work, i want one mutt config file with one set of colors. When i log in anywhere else, it's probably from my laptop, so i choose a config file with a different set of colors. In order to make sure all my changes are saved correctly, here's what i did: remove a file called 'flag', if it exists grep the output of 'w' for my gateway name output to the file 'flag' if 'flag' exists, cat my basic config file with one set of colors else cat them to another set. I'm sure there's an easier way to do this. I also need to be able to save changes easily, so when i logout, i don't have to mess with a changed .muttrc trying to merge diffs into the base version. Any suggestions? jm -- -------------------------------------------- Jonathon McKitrick -- jcm@freebsd-uk.eu.org The spice must flow.... -------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message