blueFast
blueFast

Reputation: 44381

Strange sed command

I was trying to install docker in Ubuntu, and following the instructions I have come across a very strange sed command which I do not understand (this seems to be used to set-up bash autocompletion for docker):

sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io

What is that command doing? The -i command means in-place editing, but what does the $acomplete -F _docker docker mean? The $ is matching the last line, but what is it doing? I do not even recognize any sed command there! For example, a substitution command would look like:

$s/in/out/

Could somebody explain that expression for me?

Upvotes: 2

Views: 356

Answers (1)

konsolebox
konsolebox

Reputation: 75488

It appends complete -F _docker docker to the file.

From sed's manual:

a \

text Append text, which has each embedded newline preceded by a backslash.

Upvotes: 5

Related Questions