Handle race condition if index gets trimmed twice
Handle race condition if index gets trimmed twice

Bail out if parallel job already shortened the index.
Also use a fancier way of printing a possibly empty variable.

pavoljuhas/smart-change-directory,pavoljuhas/smart-change-directory