C/C++ on Linux/Unix

Moderators: Lundin
Number of threads: 314
Number of posts: 633

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
from bash to C Posted by python on 2 Apr 2010 at 11:44 AM
Hi,

I unfortunately do not have time to put myself in C or browse all the forums dedicated to this programming ...

I need to translate this little bash function in C:

myfunc()
{
 if [ "$1" ]
 then
  /bin/a arg1 arg2 "$@"
 else
  /bin/b
 fi
}


If an argument is given, then the program a is called with two new arguments, otherwise the program b is called...

Thanks



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.