X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.9 required=5.0	tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Andrew Schulman <schulman.andrew@epamail.epa.gov>
Subject: Re: Using nosleep with wrappers
Date: Tue, 16 Oct 2012 23:03:01 -0400
Lines: 38
Message-ID: <rn7s78hd96he4abi41asoaiabj9ovuvotr@4ax.com>
References: <507BE69D.3080804@alice.it> <CAEhDDbDGjBCK2yRNigWvEwk6VZsLroe5X+JiS9SoiuZh_9BS8A@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Archive: encrypt
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

> On Mon, Oct 15, 2012 at 12:34 PM, Angelo Graziosi  wrote:
> > In my .bashrc I have something like this:
> >
> > xf()
> > {
> >     LANG=''\
> >     /usr/bin/xfig -specialtext -latexfonts -startlatexFont default \
> >         "$@" 2>/dev/null
> > }
> >
> > but, trying
> >
> > $ nosleep xf
> > nosleep: Error: failed to execute command: xf
> >
> > The same occurs for
> >
> > picasa()
> > {
> >     TEMP=/home/$USER/Temp TMP=/home/$USER/Temp \
> >     cyg-wrapper.sh "/WinXP/Programmi/Google/Picasa3/Picasa3.exe" \
> >         "$@" 2>/dev/null
> > }
> >
> >
> > Is there some tricks to have nosleep working with wrappers like the above?
> 
> Hi Angelo,
> You'll probably have to invoke bash explicitly; something like this (not tested)
> 
> nosleep bash -c xf

Right.  nosleep will run a command, which has to be an executable file that
lives somewhere in your PATH.  You're trying to use nosleep to run functions,
which are internal objects in bash.

Csaba's suggestion may work.  Or, you could put the commands into separate bash
scripts that live in your PATH.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

