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.
我有一个看起来像这样的输入文件:
VAR1=1 VAR2=2 VAR3=3 VAR4=.T.
我想读入这些变量并这样定义它们。我试过了
while read line do exec $line done < "Master.inp"
我试过了
$line
相反,但这也不起作用。有没有办法像我刚刚在 bash 文件中键入字符串一样运行字符串?
您只需获取代码即可:
. file
这将让您使用 vars $VAR1, $VAR2, ...
$VAR1
$VAR2
$ cat a VAR1=1 VAR2=2 VAR3=3 VAR4=.T. $ cat b . a echo $VAR1 $ ./b 1
我一直在研究一些 RSS抓取工具,它可以解析来自多个来源的数据。也就是说,所有这些来源都有自己的 RSS 描述实现。
特别是,使用 CDATA 标记将描述写在 like 上,例如
<![CDATA[ <p align=justify><font face="verdana, arial, helvetica,