Batch file 为git bash脚本创建bat文件
大家好。我安装了git bash,希望实现一些自动化。我有一个.bat文件,我想作为Batch file 为git bash脚本创建bat文件,batch-file,git-bash,Batch File,Git Bash,大家好。我安装了git bash,希望实现一些自动化。我有一个.bat文件,我想作为 some.bat param | iconv -cp1251 > l.log | tail -f l.log 我不想在WinCMD中运行它,而是在git bash shell中运行它-告诉我怎么做?git bash在windows上使用。您可以使用bash创建一个快速脚本,该脚本可以接收参数并回显它们,以便将它们通过管道传输到下一个实用程序 它可能看起来像这样 文件:some.sh #!/bin/ba
some.bat param | iconv -cp1251 > l.log | tail -f l.log
我不想在WinCMD中运行它,而是在git bash shell中运行它-告诉我怎么做?git bash在windows上使用。您可以使用bash创建一个快速脚本,该脚本可以接收参数并回显它们,以便将它们通过管道传输到下一个实用程序
它可能看起来像这样
文件:some.sh
#!/bin/bash
#Lots of fun bash scripting here...
echo $1
# $1 here is the first parameter sent to this script.
# $2 is the second... etc. $0 is the script name
然后将some.sh设置为可执行文件
$ chmod +x some.sh
然后,您将能够在git bash shell中执行它
./some.sh param | cat ... etc | etc...
您可以阅读有关bash编程的内容
我想看一些bash脚本教程,比如