You use the variable $1
instead of $bbpass
.
The $1
means first argument. So if you pass in two arguments, you can access then with $1
and $2
respectively.
Я пытаюсь сделать простую команду для запуска скрипта в моем личном Bitbucket. Сценарий должен быть запущен от имени пользователя root, и он затем загрузит больше файлов из репозитория, поэтому мне нужен пароль для учетной записи bitbucket.
Как мне перейти $bbpass
на runme.sh
?
read -s -p "Password:" bbpass && curl --user myuser:$bbpass https://bitbucket.org/myuser/misc/raw/tip/runme.sh | sudo bash && unset bbpass
runme.sh:
#!/usr/bin/env bash echo "Hello world!" echo $bbpass
You use the variable $1
instead of $bbpass
.
The $1
means first argument. So if you pass in two arguments, you can access then with $1
and $2
respectively.