Bash: Why is echo adding extra space?

后端 未结 7 1967
轻奢々
轻奢々 2021-01-04 11:15

I get:

$ echo -e \"D\"{a,b,c}\".jpg\\n\"
Da.jpg
 Db.jpg
 Dc.jpg

Note: The extra spaces before Db and Dc on the 2nd and 3rd line of the outp

7条回答
  •  走了就别回头了
    2021-01-04 11:44

    You can get the desired effect by using xargs to separate the arguments spit by the first echo into a line each:

    $ echo "D"{a,b,c}".jpg" | xargs -n1 echo
    Da.jpg
    Db.jpg
    Dc.jpg
    

提交回复
热议问题