TransWikia.com

How to get correct environment when launching cygwin script?

Super User Asked by Bowi on December 30, 2020

When I have this small script:

#!/bin/bash
echo "Hello!"
sleep 5

I can launch it from my Cygwin bash and it works (=prints Hello!, sleeps 5 seconds and exits).

However, when I launch it directly from my Windows Explorer, double clicking the script file, opening it with Cygwin’s bash.exe, it doesn’t find sleep (line 3: sleep: command not found), unless I write it /usr/bin/sleep.

What am I doing wrong? Do I have to open the script file with anything else than bash.exe, or is there some magic command that loads the correct environment?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP