start-stop daemon

Jeroen Coumans jeroencoumans at gmx.net
Wed Apr 23 10:18:26 PDT 2003


Michael A. Peters wrote:
> On Wed, 2003-04-23 at 03:46, Jeroen Coumans wrote:
> 
>>Try it with a proper function:
>>which () {
>>	unalias -a
>>	unset -- "$@" &> /dev/null
>>	enable -n -- "$@" &> /dev/null
>>	type -p "$@"
>>}
>>
>>Assuming there's a #!/bin/bash on top. Else, use that as a seperate 
>>shell script.
>>
> 
> #!/bin/bash
> # test.sh
> 
> which () {
> unalias -a
> unset -- "$@" & > /dev/null
> enable -n -- "$@" & > /dev/null
> type -p "$@"
> }
> 
> which sshd
> #EOF
> 
> 
> When I try that I get:
> 
> test.sh: line 7: enable: sshd: not a shell builtin
> 
> what am I missing?

I don't know exactly, but this works:

root:# cat /usr/bin/which
#!/bin/bash
# Begin /usr/bin/which

unalias -a
unset -- "$@" &> /dev/null
enable -n -- "$@" &> /dev/null
type -p "$@"

# End /usr/bin/which
root:# which sshd
/usr/sbin/sshd

-- 
Groeten/Greetings
Jeroen Coumans

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list