I want to enter my container and do something, then leave this container.
#!/bin/bash
docker exec -i ubuntu-lgx bash << EOF
echo "test file" >> /inner.txt
ls -l /inner.txt
content=`cat /inner.txt`
echo ${conent}
# do something else
EOF
when I run this script, the bash tell me the file is not exist.but the ls can output the file's property.
cat: /inner.txt: No such file or directory
-rw-r--r--. 1 root root 58 Nov 14 11:51 /inner.txt
where am I wrong? and how to fix it?