sh 用(git)bash在windows上生成虚拟文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 用(git)bash在windows上生成虚拟文件相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env bash


let "_1M = 1024 * 1024"

for i in $(seq -f "%02g" 1 10); do
let "SIZE = $i * $_1M"
	for j in $(seq -f "%02g" 1 10); do
	FILE="${i}m-${j}.bin"
	if [ ! -f $FILE ] 
	then
		fsutil file createnew $FILE $SIZE
	fi
	done

done

# fsutil file createnew 1m.bin `$_1M * 10`

以上是关于sh 用(git)bash在windows上生成虚拟文件的主要内容,如果未能解决你的问题,请参考以下文章

-bash: ./centos-7.6.sh: /bin/bash^M: bad interpreter问题解决

Ubuntu下shell脚本运行异常:bash和dash的区别

如何在不使用“sh”或“bash”命令的情况下运行 shell 脚本?

sh 在Windows10 bash中安装NOde

sh 在Git Bash Windows中创建一个Docker别名

sh 在Windows 10上禁用Linux Bash的蜂鸣声