我有以下文件min.conf,如下所示。我需要将路径目录更改为文件中的当前目录。
输入文件(min.conf)
#!/bin/bash
#
#SBATCH --workdir=/work/LAS/input
myNAMD2=$(which namd2)
myWork=/work/LAS/input
我有以下代码:
#!/bin/bash
filename="min.conf"
#While loop to read line by line
while IFS= read -r line; do
#If the line starts with ST then set var to yes.
if [[ $line == '#SBATCH --workdir='* ]] || [[ $line == 'myWork='* ]] ; then
fi
done < "$filename"
所需的输出量(最低配置):
#!/bin/bash
#
#SBATCH --workdir=/work/input23
myNAMD2=$(which namd2)
myWork=/work/input23