Home » Questions » Computers [ Ask a new question ]

Re-indent shell script

Re-indent shell script

"I have a large shell script that uses a mixture of spaces and tabs. I want to re-indent
the whole file based on syntax, like Eclipse's Format. Is there a program (beautify ?) that will do this ?"

Asked by: Guest | Views: 305
Total answers/comments: 1
Guest [Entry]

"It looks like shfmt could do the trick for you. It formats shell/bash code, which includes indentation.

shfmt -l -w script.sh"