Echo command in Dockerfile used to write aliases missing -e flag?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
As of 2/2/25
In the Dockerfile for openworm,
RUN echo '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alt"' >> ~/.bashrc
doesn't seem to update bashrc properly
Running source ~/.bashrc throws the below error
root@1a2cf2d71234:/# source ~/.bashrc
bash: nnalias: command not found
As the aliases aren't written into the bashrc correctly
Instead, using -e interprets the string properly
RUN echo '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alt"' >> ~/.bashrc
~/.bashrc with -e
alias cd..='cd ..'
alias h='history'
alias ll='ls -alt'
~/.bashrc without -e
\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alt"
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the RUN echo command in the Dockerfile and reproduce the ~/.bashrc result by sourcing it in the container. Compare the escaped newline handling with and without echo's -e option; done means the aliases load without a source error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, docker
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100