# Interactive: login profiles, ENV (parameter-expanded), and prompt escapes. command -v python3 >/dev/null 2>&1 || exit 77 mkdir home printf 'echo "profile read"\nPROFILE_VAR=yes\nPS1="$ "\n' >home/.profile # /etc/profile comes first and a Linux distribution's version may be # bash-flavoured: it can fail on a construct only bash understands, and it # sets USER from the account database. Drop the first from the transcript # and put USER back for the \u test (ENV is read after the profiles). printf 'echo "env file read"\nalias ll="echo aliased"\nUSER=tester\n' >home/envfile HOME=$PWD/home ENV='$HOME/envfile' PS1='$ ' HISTFILE='' USER=tester \ python3 "$TESTS/tools/ptydrive.py" "$TSH" -l >out 2>&1 <<'END' expect env file read send echo "var=$PROFILE_VAR"\r expect var=yes send ll\r expect aliased send PS1='[\\u] '\r expect [tester] send cd; PS1='\\W:\\x> '\r expect home:\x> send PS1='a\\\\b> '\r expect a\b> send PS1='multi\\nline> '\r expect line> send PS1='$ '\r send echo done\r expect done send exit\r END grep -v -e 'bad substitution' -e 'not found' -e 'syntax error' out