Термин Среда переменная не установлена

Это код, который я хочу выполнить с помощью motd:

#!/bin/bash
IP=`ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
#clear
echo -e "Welcome to \e[0;32mDMS 4\e[0m"
echo
echo -e "Connect with your Browser to following IP-Address: \e[0;32mhttp://$IP\e[0m"
echo
echo "If no IP-Address is shown above then"
echo "maybe there is no DHCP-Server available in your network."
echo "If so you have to change the IP to a static Address."
echo -e "Just type \e[0;32mnetconf\e[0m and press Enter"

Я поместил /usr/sbin/autologin-screen (местоположение скрипта) в моем файле 00-header в папке /etc/update-motd.d.
Кто-нибудь есть идея, почему я получаю эту ошибку:

TERM environment variable not set

Примечание * Удаление Очистить 1 ошибка. У меня еще есть другой TERM environment variable not set

0
задан 30 July 2014 в 16:22

1 ответ

Согласно motd руководство :

   The  contents of /etc/motd are displayed by login(1) after a 
   successful login but just before it executes the login shell.

согласно руководство входа в систему:

   On some installations, the environmental variable $TERM will be
   initialized to the terminal type on your tty line, as specified in
   /etc/ttytype.

и согласно четкое руководство :

   It looks in the environment for the terminal type and then in the
   terminfo database to  figure out how to clear the screen.

я предполагаю, что переменная ТЕРМИНА установлена после Вашего motd выполнение сценариев и из-за этого, ясный печать команды TERM environment variable not set.

На lubuntu 12.04 я протестировал это unset TERM и должностное лицо clear. В этом условии я получаю ту же ошибку.

2
ответ дан 30 July 2014 в 16:22

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

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