
O bash não fornecerá arquivos de um terminal de login, a menos que eu execute manualmente o bash a partir de um terminal, eu tenho o bash (e não sh ou dash). Quando eu forneço um arquivo, ele retorna erros (como "erro de sintaxe quase inesperado"), a menos que eu não execute$ festaantes da fonte
$echo $TERM
screen-256color
$echo $SHELL
/bin/bash
$shopt login_shell
login_shell on
Erro:
$source ./shrc
-bash: ./shrc: line 105: syntax error near unexpected token `('
$bash
$source ./shrc <-- now it works
Alguma ideia?
ATUALIZAÇÃO 1
Quando executo o bash, entro no shell non_login e funciona. Por que o shell de login não consegue gerar o arquivo?
ATUALIZAÇÃO 2
$echo $0
-bash
$bash
$echo $0
bash
ATUALIZAÇÃO 3
else
echo;
echo "The SPEC environment variable is not set! Please source the shrc and try again."
echo;
fi
}
ogo() { <----- LINE 105
SHRC_NO_GO=0
TOP=$SPEC
if [ "x$TOP" != "x" ]; then
if [ "x$1" = "x--help" -o "x$1" = "x-h" ]; then
É um arquivo de benchmarks SPEC2006 (é um programa bem conhecido, não é meu código). Minha suposição é que está correto. (na verdade, em shell sem login, funciona)
Responder1
$SHELL
armazena seu shell padrão, não seu shell atual. Em vez disso, tente echo $0
:
$ echo $SHELL
/bin/bash
$ echo $0
dash