Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <19991101184001.2086.rocketmail@web109.yahoomail.com> Date: Mon, 1 Nov 1999 10:40:01 -0800 (PST) From: Earnie Boyd Reply-To: earnie_boyd AT yahoo DOT com Subject: Re: sed To: Mike MacDonald , "'cygwin AT sourceware DOT cygnus DOT com'" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii --- Mike MacDonald wrote: > Ok, well, sed won't let me strip a linefeed from the end of a line.. This > is a little important because I'm trying to fix configure to install .exe > files.. Is this a bash limitation, or is there a better sed out there I can > use? Try this: ----------------------< snip snip snip >-------------------------- #! /bin/sh # file: install # author: earnie email: earnie_boyd AT hotmail DOT com # # Install Preprocessor for the gnuwin "make install" command. # # Purpose: # Automatically add the suffix .exe to filenames that require it # # To use: # Copy this file earlier in the path than the default install.exe # It is recommended that the original install.exe be renamed # cyg_install.exe as otherwise some configure programs may fail # to find this install script # # Note: # No warranty implicit or explicit is given. # You may copy, distribute and use as you see fit. # USE AT YOU OWN RISK. # # changed: M.Hirmke email: mh AT mike DOT franken DOT de # changed ginstall to cyg_install, because some packages are looking # for ginstall # # changed: Dr David Coe email: david AT coent DOT demon DOT co DOT uk # "I seem to remember earnie's script gave trouble (in X11 or lesstif # make install) when both and are present # simultaneously). The attached helped." # # changed: Dr Pierre A. Humblet email: humblet AT eurecom DOT fr # Modify logic to work when several files are installed in a directory, # some with the .exe extension and others without. # Issue warning in case of ambiguity # Search for an appropriate install.exe program tstr="" ambiguous="" while test $# -gt 1; do suffix="" if test -e "$1.exe"; then if test \( -f "$1" -o -L "$1" \) -a \ \( "$(ls -ib "$1").exe" != "$(ls -ib "$1".exe)" \) then ambiguous="${ambiguous}'$1' '$1.exe' " else suffix=".exe" fi fi tstr="${tstr}'${1}${suffix}' " shift; done if test -d "$1" then suffix="" fi tstr="${tstr}'${1}${suffix}'" # Issue warning if needed if test "$ambiguous" then echo $0 Warning: ambiguous filenames. Specify '".exe"' if appropriate. 1>&2 echo $0 "$ambiguous" 1>&2 fi # use cyg_install[.exe] if found, otherwise use install.exe type cyg_install >/dev/null 2>&1 if test "$?" = "0" then eval "cyg_install $tstr" else eval "install.exe $tstr" fi exit ----------------------< snip snip snip >-------------------------- ===== Earnie Boyd Newbies, please visit __________________________________________________ Do You Yahoo!? Bid and sell for free at http://auctions.yahoo.com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com