我想将bash引用parfor
解释为
更多我想在bash中执行以下命令行
"
我尝试用bash脚本包装它:
gnuplot -e "filename='data.dat'" plot.gnuplot
并执行这样的abash bashscript
#!/bin/bash
# -*- coding: utf-8 -*-
gnuplot -e "filename=\'${1}\'" plot.gnuplot
但它显示了这一点:
bash -x plot.sh data.dat
怎么做?
答案 0 :(得分:1)
尝试在命令之前设置变量:
path="filename='${1}'"
gnuplot -e "$path" plot.gnuplot
如果引号需要在变量周围:
path="\"filename='${1}'\""
gnuplot -e "$path" plot.gnuplot
将变量设置为一个命令:
gnuplot -e "\"filename='${1}'\"" plot.gnuplot