29 Nov
2001
29 Nov
'01
00:14
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