Skip to content

Echo command in Dockerfile used to write aliases missing -e flag? #361

@NickCheng0921

Description

@NickCheng0921

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions