X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C25D3857719 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1691430014; bh=SyUfXdTewPKc7IAz2VexbGcgcbRJ/c3Xs4JSKONzRPU=; h=In-Reply-To:References:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=o633D4MFgPVByuB58SJGVpaKrVUJTlR+XGTeAxMogL4LJAN2ZR3W10PfwubJ5LVuq nPk9mHNyE0tCDyPpucBTlZi9GvUFu4tMj3EzBC/IugZmMfbrLl2Ttj8sOqAgwQi+t6 19uOcLxnjFtRH0zRj/T/6LzHwLBJYdZIqoAqlyMI= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 595733857803 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691429977; x=1692034777; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M9+JvasN+GkQDijqgliO8AgejXO2N4juSxoItHD50ro=; b=kVSPO2Vp64YlYFdNm4A6dvCLHGcdZF8YSciX37qJZ4M0xtDNF2B/plWdKVizF9nLJB KknXrHKbcDy0ctH7azzyeZGgPRU+m8JcwbfdNO9+ujaX/BCy0WA+Z4DJtjJ31PkQyuDM 1i3HgcpPt0UWdHsRydOZR4eTPARNtsdnWsCwOhXWTNAlz6MgfI1HqwYXA3vM0bzlXfM6 N7lR9B46F2jzXuS6yBTXlbg4V0IsSxqTlC9U382VKtqAn6nVLu0tLuJj2WSSF0Ppueo3 z+c9ZQ4RKcK6JYmlmwhPddQF4dpmAdLHTUczGw4dc9rVXWff6ZacyfSH05eTG78nfu57 /7fg== X-Gm-Message-State: AOJu0YyqrPdj7YGqnlpa40Y3FgbQZ6vpesYORwJt8e26bXixmj1xZX9C U/JpIvGUEWQsgWO7+lYBM//0clELYXAe8AjfsYgsHz2V X-Google-Smtp-Source: AGHT+IGmDFODARDwbLj4qH0nhv3wJtU4TaGWktOSvIVGDzsHUaSR6SdTp29MEVQp3FpxZ6NnyUGmXzQzj42nvhQxcw4= X-Received: by 2002:a05:6871:89f:b0:1bb:973a:6752 with SMTP id r31-20020a056871089f00b001bb973a6752mr11792443oaq.25.1691429976460; Mon, 07 Aug 2023 10:39:36 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 7 Aug 2023 13:39:35 -0400 Message-ID: Subject: Re: Entering Cygwin command line (bash login) from Windows cmd.exe ? To: Roland Mainz Cc: cygwin AT cygwin DOT com, Roland Mainz X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , From: Lee via Cygwin Reply-To: Lee Content-Type: text/plain; charset="utf-8" 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 377HeFMD021282 On 8/7/23, Roland Mainz via Cygwin wrote: > On Sat, Jul 29, 2023 at 6:18 AM Roland Mainz wrote: >> Is there an official way to enter the Cygwin command line (e.g. bash >> login) from Windows cmd.exe, e.g. if someone ssh's into a Windows >> machine he/she ends/up in a cmd.exe and not bash... > > ping! Years ago this was the default way to start cygwin (I don't think I've changed it, but who knows??) C:\cygwin>type Cygwin.bat @echo off C: chdir C:\cygwin\bin bash --login -i There's a Cygwin.bat in /etc/defaults that needs to be copied to the cygwin root directory: C:\cygwin>type etc\defaults\Cygwin.bat @echo off setlocal enableextensions set TERM= cd /d "%~dp0bin" && .\bash --login -i C:\cygwin> "cd /d" - Use the /D switch to change current drive in addition to changing current directory for a drive. "%~dp0" gives the path of the script, so if the .bat file is in C:\cygwin then "%~dp0bin" expands to C:\cygwin\bin Regards Lee -- 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