English 中文(简体)
紧随产出左侧
原标题:Join string to the left side of output

我怎么能够加入从左边到产出的扼杀?

例如:我们希望加入参数=“档案/”

备注:档案=/dir1/dir2/(档案具有价值)

    echo  aaa bbb |  awk  {print $2}  | sed ....

印刷

    /dir1/dir2/bbb
最佳回答

假设你的投入是好的,就足够了。

sed "s|(.*)|$VARIABLE1|"
问题回答
echo aaa bbb | awk  {print "file/"$2} 

如何:

echo aaa bbb | awk  { print "file/" $2 } 




相关问题
Concatenating strings in macros - C++

What s the easiest way to concatenate strings defined in macros. i.e. The pseudo code I m looking for would be like: #define ROOT_PATH "/home/david/" #define INPUT_FILE_A ROOT_PATH+"data/inputA.bin" #...

How can I concatenate set of results in MySQL?

I would like to join results returned in the set in MySQL with a comma as a separator string. For example, set returned contains: COLUMN_X john jerry maria joseph gugla I would like to receive the ...

热门标签