我遇到了这个sfdisk调用
sfdisk {device} <<EOF
label: dos
unit: sectors
4MiB,252MiB,
256MiB,,
EOF如何将这个“脚本”转换成一系列sfdisk调用?
sfdisk ...
sfdisk ...发布于 2020-09-13 00:56:52
如果您的问题是如何在bash脚本中运行一系列命令,那么对于this question,公认的答案是很好的。即-
A; B # Run A and then B, regardless of success of A
A && B # Run B if and only if A succeeded
A || B # Run B if and only if A failed
A & # Run A in background.如果您的问题更多地是关于使用sfdisk实用程序生成脚本,this question有一个很好的答案来解释如何做到这一点。即-
To generate an example script, get the setup of one of your disks:
sudo sfdisk -d /dev/sda > sda.sfdisk发布于 2020-09-13 00:53:06
将设备布局内容的以下描述保存到一个文件例如: sda.dump,并将其作为输入提供。
label: dos
unit: sectors
4MiB,252MiB,
256MiB,,
Example :
sfdisk {device} < sda.dumphttps://stackoverflow.com/questions/63862593
复制相似问题