help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] A do nothing function


From: Greg Wooledge
Subject: Re: [Help-bash] A do nothing function
Date: Thu, 27 Sep 2012 13:13:58 -0400
User-agent: Mutt/1.4.2.3i

On Thu, Sep 27, 2012 at 12:07:45PM -0500, Peng Yu wrote:
> For example, in pseudo code
> 
> function cmd1 {
> if some condition
> 
> }

I'm not sure what you're trying to say there.  It's rather cryptic
without some context.  Can you explain what is wrong with the "cat"
solution?

Avoid using "function" to define functions.  It's non-POSIX syntax, and
therefore your script will only work in bash and not necessarily in sh.
Ksh also has "function" but it means something different, and therefore
makes things even MORE confusing.

So just use the standard definition syntax:

cmd1() {
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]