|
From: | Linda Walsh |
Subject: | Re: typeset -p & manpage on it are confusing w/rt funcs |
Date: | Sat, 08 Jun 2013 18:44:03 -0700 |
User-agent: | Thunderbird |
Greg Wooledge wrote:
On Thu, Jun 06, 2013 at 03:48:09PM -0700, Linda Walsh wrote:I wanted to test to see if a function was definedimadev:~$ declare -f foo >/dev/null 2>&1 ; echo $? 1 imadev:~$ declare -f bar >/dev/null 2>&1 ; echo $? 0 Obsolete. See `help declare'. But "typeset" does work in place of "declare" in the examples above. They appear to be interchangeable, for now, in this particular case.
----- Yeah, I see that, I supposed I was looking for output from decl/typeset from the -p switch showing just the funcname with any attrutes ( like export).. just as it does for the variables... unless it is a local function and then I see -- for the attributes. The confusing part is having the -f and -F in the same paragraph as -p. It looks like it is a paragraph mostly about 'p', and so you read -p prints all names+attr Us9ing -f will restrict the display to shell functions and -F inhibits them. --- When used with '-p'? no -- as it ealier says 'f' can't be used with any other args if it is used with a name. Seems like if I type declare -p 'funcname', I get ' typeset -p include -bash: typeset: include: not found -- I tried to use it with -f to just see functions: typeset -fp include -bash: typeset: include: not found ... -p can't be used with -f, but the manpage puts them in the same paragraph like they are related switches -- where -f/-F can be used to modify the output of -p -- which doesn't seem to be the case. That's the confusion, really... Just some unclarity in the words, I thought. no biggie.
[Prev in Thread] | Current Thread | [Next in Thread] |