Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 bash 脚本中的 gnuplot,我必须将值从两列中分开:
使用 1:($4/$6) notitle 和 lp 绘制“results.csv”
这在 gnuplot 交互模式下工作得很好,但是当从脚本调用时,列值会与 bash 脚本参数混合在一起......我怎样才能传递 col. 脚本中的值?
正如 Sean 在评论中所问的,这取决于您从脚本中调用 gnuplot 的准确程度。
除非它在单引号中,否则类似的东西$4将被扩展,所以这是一种选择。在其他任何地方,您都必须逃避$:
$4
$
# print first argument echo $1 # print literally $1, a few ways echo '$1' echo "\$1" echo \$1