我有一系列声音片段,我想将它们分配给我的.bashrc中的变量来播放特定的声音片段。
我知道我可以在那个目录上做afplay "sound/path.mp3",但我想要更简单的东西。
afplay "sound/path.mp3"
如果我可以在终端打电话给$WHAT,那就玩Lil Jon的'WHHATT!'
$WHAT
如果我理解正确,我会说你可以在你的.bashrc中加入这样的东西:
what2() { /path/to/afplay "/path/to/my.mp3" }
这将允许您在命令行上使用命令'what2'。