line 54: warning: here-document at line 42 delimited by end-of-file (wanted `EOF')
bash, eof
Solution
You can also use
<Tab><Tab>cat <<-EOF >>$dir/.bashrc
#--------------------^- added a "-" char
<Tab><Tab> echo " ... "
<Tab><Tab> echo " ... "
<Tab><Tab>EOF
where EOF is now preceded with a `-` character. This indicates to the shell that the closing Here-file token will be (can be) indented with tab characters. If you write, by accident, `<Tab><Tab><Space>EOF` it will not match, but 0,1,2,...,100 `<Tab>EOF` will match.
IHTH
Problem
I got bash script, but when I run it I got some error: line 54: warning: here-document at line 42 delimited by end-of-file (wanted `EOF') ``` #!/bin/bash echo "PODAJ IMIE" read imie echo "PODAJ NAZWISKO" read nazwisko alias="$imie$nazwisko" echo "$alias" while [ 1 ] do i=1 if [ `egrep $alias /etc/passwd |wc -l` -gt 0 ]; then i=0 fi if [ $i -eq 0 ]; then echo "Uzytkownik o podanym aliasie już istnieje!" echo "PODAJ INNY ALIAS np. "$alias"1" read alias else echo "PODAJ HASLO" read -s password echo "PODAJ NUMER POKOJU" read pokoj #adduser --disabled-password --gecos "$imie $nazwisko,$pokoj, ," $alias adduser --quiet --disabled-password -shell /bin/bash --home /home/$alias --gecos "$imie $nazwisko, $pokoj, , " $alias echo "$alias:$password" | chpasswd #echo -e "$haslo\n$haslo\n" | sudo passwd $alias dir=/home/$alias mkdir $dir/public_html mkdir $dir/samba cd $dir/public_html mkdir private_html cat <<EOF >>$dir/.bashrc echo "alias ps =/bin/ps" echo "alias ls =/bin/ls" t=\`date +%F.%H:%M:%S\` echo "WITAJ\n" echo "DZISIAJ MAMY:\$t" echo "TWOJE OSTATNIE LOGOWANIE:" && " lastlog -u \$USER | tail -n 1 | awk '{print \$4" "\$5" "\$6" "\$7" "\$9}'" EOF break fi done ```