X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CADBF3858401 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.umass.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.umass.edu Subject: Re: Running a command in a specific directory To: =?UTF-8?Q?Piotr_Gli=c5=baniewicz?= , cygwin AT cygwin DOT com References: <8034c9ba-8384-a239-faf8-e8376d6dbc2e AT gmail DOT com> From: Eliot Moss Message-ID: Date: Tue, 22 Mar 2022 18:40:30 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <8034c9ba-8384-a239-faf8-e8376d6dbc2e@gmail.com> Content-Language: en-US X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: moss AT cs DOT umass DOT edu Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 22MMf9g3026373 On 3/22/2022 6:35 PM, Piotr Gliźniewicz wrote: > Hi, > > I'm trying to run a command at a specific "Windows" path. Basically something similar to what chere > does for bash, but I want to execute ls in bash for a specific directory. I've tried variations of > what chere leaves in the registry: > > C:\cygwin64\bin\bash.exe -c "/bin/xhere /bin/bash.exe '%L'" > > Adding simply `-c ls` didn't work. > > To start with something simpler I've launched bash and tried just to guess what xhere want's, but I > don't really know what's happening. I couldn't find any help for xhere. > > /cygdrive/c > $ /bin/xhere '/bin/bash.exe -c ls' d: > /bin/xhere: line 38: [: too many arguments > /bin/xhere: line 41: [: too many arguments > /bin/xhere: line 64: [: too many arguments > Starting /bin/bash.exe -c ls > -/bin/bash: ls: command not found > > /cygdrive/c > $ /bin/xhere "/bin/bash.exe -c ls" d: > /bin/xhere: line 38: [: too many arguments > /bin/xhere: line 41: [: too many arguments > /bin/xhere: line 64: [: too many arguments > Starting /bin/bash.exe -c ls > -/bin/bash: ls: command not found > > Any hints, how to properly pass `/bin/bash.exe -c ls` to xhere? I'm not familiar with xhere; I would just do something like: C:\cygwin64\bin\bash.exe -c "cd place/I/want/to/be; ls" Cheers - EM -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple