在Windows bat文件中运行cygwin命令

问题描述 投票:0回答:1

试图在Windows批处理文件中运行cygwin命令,但是,cygwin命令仅到达cygwin交互式提示。

我的代码在Windows bat文件中如下所示

@echo off

C:
chdir C:\cygwin\bin

bash --login -i
split -l 1 test.txt
logoff
exit

仅到达cygwin / linux的命令界面command prompt reached

linux batch-file cygwin
1个回答
2
投票

使用bash --login -i时,请输入交互式bash shell。

您需要的是:

bash -c "cd /path/to/your-test-txt; split -l 1 test.txt"
© www.soinside.com 2019 - 2024. All rights reserved.