I usually go to stackexchange when I face programming terminal and I spend most of time trying to append four spaces before my pasted programming code.Is there any faster way to do it from a terminal?What would you do?
How can I add four spaces before each lines of programs code in terminal
bash;text processing
Simply use sed,sed 's/^/    /' fileThis appends four spaces before each line. Add an inline edit option -i  to save the changes to the specified file.sed -i 's/^/    /' fileThrough awk,awk '{sub(/^/,     , $0)}1' fileORawk '{print     $0}' file