FBB::Exec(3bobcat)

✨ FBB::Exec β€” it's giving "run other programs" energy ✨

okay bestie, so this page lives in the 3bobcat manual (yes, FBB::Exec(3bobcat), that's the whole vibe) and it's literally about Executing Child Processes. Let's get into it 🫢


πŸ’– NAME πŸ’–

FBB::Exec β€” runs external programs. no cap, that's the whole job.


🌸 SYNOPSIS 🌸

#include <bobcat/exec>

Linking option: -lbobcat


πŸ¦‹ DESCRIPTION πŸ¦‹

The FBB::Exec class hands you a basic interface for calling external programs (a.k.a. "child processes", a.k.a. lil baby programs you spawn 🍼). But listen β€” the standard streams of those child processes are not handled by Exec objects. The child process just uses the parent's standard streams. Sharing is caring, I guess.

Also, the PATH environment variable is not used when calling child processes. So you can't just be like "run cp" and expect the system to find it. Child process programs must be specified using paths. periodt.

Exec objects may be used repeatedly to execute the same or different child processes. But here's the rule: before starting the next child process, the current child process must have finished. one at a time, we don't do chaos here πŸ’…

Arguments passed to child processes may be surrounded by double or single quotes, and they each behave differently, so pay attention:

  • Arguments surrounded by double quotes have their double quotes removed, while interpreting any escape-sequences that may have been used within.
  • Arguments surrounded by single quotes have their single quotes removed, while accepting their content as-is.
  • In addition, unquoted escape-sequences may be specified: those escape sequences are evaluated and replaced by their intended characters (e.g., \100 is converted to @).

πŸ‘‘ NAMESPACE πŸ‘‘

FBB

All constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB.


🧚 INHERITS FROM 🧚

FBB::Fork


πŸŽ€ CONSTRUCTOR πŸŽ€

Only the default constructor is supported. that's it. that's the constructor menu 🌈


πŸ’… MEMBERS πŸ’…

  • bool execute(std::string const &cmd) β€” the argument specifies the command to execute: the command itself must be specified as a path (the PATH environment variable isn't used, remember?). This member returns true if the child process's exit value equals 0. Otherwise false is returned. Once execute has returned it can be called again, either using the same or another command. Here's the important part though: the class Exec does not offer facilities to forcefully terminate child processes β€” parent processes are suspended until the child processes have completed. Like, you're just waiting, bestie. 🌸 Arguments passed to the program to be executed as child process may optionally be specified using single or double quotes, as described in this man-page's DESCRIPTION section.
  • int ret() const β€” once execute has returned, this member provides the actual exit code of the child process. Its value equals -1 before the first execute call. (yes, the original spells it "exectue", we don't talk about it 😭)

πŸ”₯ EXAMPLE πŸ”₯

#include <iostream>
#include <bobcat/execfork>

using namespace std;
using namespace FBB;

int main()
{
    ExecFork ef;

    if (ef.execute("/bin/cp driver.cc /tmp"))
        cout << "driver.cc now copied to /tmp\n";
    else
        cout << "could not copy driver.cc to /tmp\n";

    cout << "Again:\n";

    if (ef.execute("/bin/cp driver.cc /tmp"))
        cout << "driver.cc now copied to /tmp\n";
    else
        cout << "could not copy driver.cc to /tmp\n";

}

πŸ“ FILES πŸ“

bobcat/exec β€” provides the class interface


⭐ SEE ALSO ⭐

bobcat(7), cerrextractor(3bobcat), cininserter(3bobcat), coutextractor(3bobcat), execl(3), fork(3bobcat), process(3bobcat), stdextractor(3bobcat).


πŸ’€ BUGS πŸ’€

None reported. we love a clean record ✨


🌈 BOBCAT PROJECT FILES 🌈

Debian Bobcat project files:

  • libbobcat6: debian package containing the shared library, changelog and copyright note;
  • libbobcat-dev: debian package containing the static library, headers, manual pages, and developer info;

πŸŽ€ BOBCAT πŸŽ€

Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’. yes the backtick is doing its own thing there, iykyk πŸ™ˆ


This is free software, distributed under the terms of the GNU General Public License (GPL).


πŸ‘‘ AUTHOR πŸ‘‘

Frank B. Brokken (f.b.brokken@rug.nl).


and that's the whole page bestie πŸ’– this was libbobcat-dev_6.15.01, dated 2005-2026 β€” mwah, iconic, no notes πŸŽ€βœ¨

πŸ“¦ where this page comes from