Проблема с выполнением псевдонима команды в Ubuntu 18.04

Я создал файл псевдонима для удержания псевдонима

nano .bash_aliases

, а затем использовал команду

alias ganache='./ganachescript'

Однако,

$ ./ganachescript

08:29:17.571 › Checking for update
08:29:19.052 › Update for version 2.4.0 is not available (latest version: 2.4.0, downgrade is disallowed).

, но если я напишу:

$ ganache
ganache: command not found

Кто-нибудь, пожалуйста, направьте меня.

1
задан 16 June 2020 в 17:03

1 ответ

That's a quite not-correct way to set an alias. The command ./ganachescript means 'execute the executable file ganachescript that exists in the current directory'. So the alias would work only when you run the ganache command in the specific directory where the ganachescript file is located.

To overcome this you need to use the full path to the ganachescript file instead as below

alias ganache='/path/to/ganachescript'
2
ответ дан 19 June 2020 в 21:24

Другие вопросы по тегам:

Похожие вопросы: