在Mac .bashrc中分配变量以播放afplay'sound / path.mp3'

问题描述 投票:0回答:1

我有一系列声音片段,我想将它们分配给我的.bashrc中的变量来播放特定的声音片段。

我知道我可以在那个目录上做afplay "sound/path.mp3",但我想要更简单的东西。

如果我可以在终端打电话给$WHAT,那就玩Lil Jon的'WHHATT!'

bash macos terminal
1个回答
2
投票

如果我理解正确,我会说你可以在你的.bashrc中加入这样的东西:

what2()
{
    /path/to/afplay "/path/to/my.mp3"
}

这将允许您在命令行上使用命令'what2'。

© www.soinside.com 2019 - 2024. All rights reserved.