sed command in bash

0 votes

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?

Jun 7 in Linux Administration by Rahul
• 3,380 points
16 views

1 answer to this question.

0 votes
sed is the Stream EDitor. It can do an entire heap of truly cool things, yet the most well-known is text substitution.

The s,%,$,g some portion of the order line is the sed order to execute. The s represents substitute, the , characters are delimiters (different characters can be utilized;/, : and @ are well known). The % is the example to coordinate (here a strict percent sign) and the $ is the second example to coordinate (here an exacting dollar sign). The g toward the end means to all around the world supplant on each line (any other way it would just refresh the principal match).
answered Jun 7 by Korak
• 5,820 points

Related Questions In Linux Administration

0 votes
1 answer

Is there a better way to run a command N times in bash?

In the event that your reach has ...READ MORE

answered Jun 16 in Linux Administration by Korak
• 5,820 points
14 views
0 votes
1 answer

How to take input from user in bash script?

You can use if-else branch to check ...READ MORE

answered Jan 31, 2019 in Linux Administration by Omkar
• 69,210 points
439 views
0 votes
1 answer

setting a variable output from a bash command

You can use $(command), which in my ...READ MORE

answered Feb 15, 2019 in Linux Administration by DareDev
• 6,890 points
1,387 views
0 votes
1 answer

Comparing two string variables in an 'if' statement in Bash

1. For string comparison, use: if [ "$s1" ...READ MORE

answered May 15, 2019 in Linux Administration by Shubham
• 13,490 points
344 views
0 votes
1 answer

How to extract file base name without path and extension in bash?

You don't actually have to call the ...READ MORE

answered May 31, 2019 in Linux Administration by Shubham
• 13,490 points
4,161 views
0 votes
1 answer

Script file name in a Bash script

$0 will give you the complete basename. ...READ MORE

answered Jun 20, 2019 in Linux Administration by Shubham
• 13,490 points
247 views
0 votes
1 answer

What is the difference between ctrl z and ctrl c in command line?

Hi@akhtar, Generally, these two commands are used to ...READ MORE

answered Feb 24, 2020 in Linux Administration by MD
• 95,360 points
20,314 views
0 votes
1 answer

What is the linux command to find Memory and CPU usage in percent for last 30 days?

Try the following: Cat proc/meminfo top top -i less /proc/memin ...READ MORE

answered Oct 14, 2020 in Linux Administration by Kim
545 views
0 votes
1 answer

Is there a limit on the number of words in bash command 'for file in words'?

Anyway, you need to print everything except ...READ MORE

answered May 27 in Linux Administration by Korak
• 5,820 points
16 views
0 votes
1 answer

Is there a better way to run a command N times in bash?

In the event that your reach has ...READ MORE

answered Jun 13 in Linux Administration by Korak
• 5,820 points
10 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP