0

I'm new programming in shell and I need some help with this code...

Buildname= test
echo $Buildname > lbuild
cbuild < lbuild
echo $cbuild

So echo $cbuild must display the first line in the text file created.

can someone help me with that?

4

2 回答 2

0

使用读取

read -r cbuild < filename
于 2012-02-17T17:09:04.680 回答
0

我认为您要么想要在测试中使用双引号,要么Buildname = test在脚本中添加更多内容。:-)

我冒昧地假设我知道你需要什么,这是我的赃物:

    #! /bin/bash

    Buildname="test"
    echo $Buildname > lbuild
    cbuild=$(cat lbuild)
    echo $cbuild
于 2012-02-17T17:04:30.347 回答