Could someone explain this command for me:
cat | sed -e 's,%,$,g' | sudo tee /etc/init.d/dropbox << EOF
echo "Hello World"
EOF
What does the “sed” command do?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
sedis the Stream EDitor. It can do a whole pile of really cool things, but the most common is text replacement.The
s,%,$,gpart of the command line is thesedcommand to execute. Thesstands for substitute, the,characters are delimiters (other characters can be used;/,:and@are popular). The%is the pattern to match (here a literal percent sign) and the$is the second pattern to match (here a literal dollar sign). Thegat the end means toglobally replace on each line (otherwise it would only update the first match).