Replace character in shell scripting

Hi,

I need to replace the space " " with underscore "_" using shell scripting. The data are inside the text file. Is there are any simple code to that.?

Yes, you might consider to look at sed .

See for example:

You can also search the site for many answers.

For single chars, tr is more obvious choice.

Give it a shot, and get back here if you get stuck, showing your attempts.

Regards
Peasant.

1 Like

Hi All,

Thanks, I used SED and it works perfectly.