Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想做这样的事情:
C:\cygwin\bin\bash --some-switch date "+%Y-%m-%d %H:%M:%S" >> unit-tests-runs.log
bash 之后的所有内容基本上都被视为我在 shell 中。
-c
你需要旗帜和-c一些引号。例如:
$ bash -c 'date "+%Y-%m-%d %H:%M:%S" >> unit-tests-runs.log'