"Unspecified Exception" when running .command bash script

522 views Asked by At

I've created a bash script to play some music using the afplay command. I used the file extension .command so that it can be opened with a double click in finder. This is an abbreviation of the code.

#! /bin/bash

afplay playlist/01.m4a

The script works when I manually run it through terminal, but when I open the .command file through finder all I get is,

admins-iMac:~ user$ /Users/admin/Documents/bash/music.command ; exit;
Unspecified exception
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

And no music is played. Any help would be appreciated.

1

There are 1 answers

0
childno͡.de On

No clue why but: afplay my played fine while mv my{,.mp3} && afplay my.mp3 won't and will exit with "Unspecified exception"