Answer the question
In order to leave comments, you need to log in
[[+content_image]]
One entry in alias is missing. Why?
I write in the console "alias" and get
[[email protected] ~]$ alias
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mc='. /usr/libexec/mc/mc-wrapper.sh'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
alias ls='ls --color=auto'
string it is necessary to remove (if any) alias for ls in the script. What would work as intended. I write something like this in a script#!/bin/bash
. $HOME/.bashrc
alias
alias ls='ls --color=auto'
(well, or whatever it would be on some other machine). The fact is that there is no "ls=" entry. There is no point in writing further. missing line...
Answer the question
In order to leave comments, you need to log in
When asked why, the answer is:
~/.bashrc pulls /etc/bashrc, which only pulls /etc/profile.d if the shell is interactive. The alias for ls comes from there. For a non-interactive shell, you can add . /etc/profile to load this alias anyway.
If the goal was to remove the alias, but it doesn’t exist anyway, then that’s it, the task is solved.
> because it is necessary to remove (if any) alias for ls in the script. What would work as intended. I write in a script such piece
Launch \ls or /bin/ls in an explicit form.
No need to shit-code on the bash =)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question