Shell command moved into try ... catch block