如何在我的配置文件中使用相对路径,以便用户无需更改USER
输出目录的路径?
我有这个:
配置.yml
proj_name: H1N1_rhesus
contact:
email: user.edu
person: user
01-preprocess: /home/user/2022-h1n1/01-preprocess/
02-salmon: /home/user/2022-h1n1/02-salmon/
raw-data: /tmp/H1N1_rhesus/
reference: /tmp/
蛇文件
#----SET VARIABLES----#
PROJ = config["proj_name"]
INPUTDIR = config["raw-data"]
PREPROCESS = config["01-preprocess"]
SALMON = config["02-salmon"]
REFERENCE = config["reference"
但想做这样的事情:
proj_name: H1N1_rhesus
contact:
email: user.edu
person: user
01-preprocess: /home/$(USER)/2022-h1n1/01-preprocess/
02-salmon: /home/$(USER)/2022-h1n1/02-salmon/
raw-data: /tmp/H1N1_rhesus/
reference: /tmp/
或这个:
proj_name: H1N1_rhesus
contact:
email: user.edu
person: user
01-preprocess: /home/$(PWD)/01-preprocess/
02-salmon: /home/$(PWD)/02-salmon/
raw-data: /tmp/H1N1_rhesus/
reference: /tmp/
但是我尝试过的方法都没有奏效。