Re: [SLE] Did SuSE hack ls or which? and: Potential damage by reverting?
Jon Clausen
So is there any potential breakage by removing that alias (scripts expecting 'which' to behave like /usr/bin/which, but getting the output of 'type -p' or vice versa)?
In general no, see bash(1): Aliases are not expanded when the shell is not interac tive, unless the expand_aliases shell option is set using shopt ... It means that "which" in a script like #!/bin/bash which ls alias is interpreted as /usr/bin/which because there are no aliases defined in the shell. -- Alexandr.Malusek@imv.liu.se
On Thursday 29 November 2001 00:24, Alexandr Malusek wrote:
Jon Clausen
writes: So is there any potential breakage by removing that alias (scripts expecting 'which' to behave like /usr/bin/which, but getting the output of 'type -p' or vice versa)?
In general no, see bash(1): Aliases are not expanded when the shell is not interac tive, unless the expand_aliases shell option is set using shopt ...
It means that "which" in a script like
#!/bin/bash which ls alias
is interpreted as /usr/bin/which because there are no aliases defined in the shell.
kewl! Thanks :) Jon Clausen
participants (2)
-
Alexandr Malusek
-
Jon Clausen