Skip to content
Advertisement

How to open files sequentially on a terminal?

I want to iterate through all files in a directory and open them with an editor, but I don’t want to open the next one until the previous has closed.

something like:

for i in pattern; do vim $i <wait until close> done

Advertisement

Answer

You don’t have to do anything; the shell blocks until vim exits each time through.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement