Find the answer to your Linux question:
Results 1 to 3 of 3
I have a problem with a trivial script (for You trivial ) performed in bash. Can you give me what bash calls for the following cases? 1. Code: int main() ...
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Location
    Poland
    Posts
    1

    Completely fresh problems guy

    I have a problem with a trivial script (for You trivial ) performed in bash. Can you give me what bash calls for the following cases?

    1.

    Code:
       
    int main() {
    printf ("aaa\n");
    if ( fork () ==0 )
       fork ();
    exit(0);
    print f ("bbb\n");
    }
    2.

    Code:
    int main() {
    printf ("aaa\n");
    if ( fork () ==0 )
    exit(0);
    fork();
    print f ("bbb\n");
    }
    3.
    Code:
       
    int main() {
    printf ("aaa\n");
     fork ();
      if ( fork () ==0 )
    exit(0);
    print f ("bbb\n");
    }

    4.
    Code:
       
    int main() {
    printf ("aaa\n");
     fork ();
      if ( fork () ==0 )
    exit(0);
    print f ("bbb\n");
    }

    I will be grateful for information. I always working only in MS Software but now I would like to learning something else.... Thank You in advance!

    S.

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    looks suspiciously homework like to me

    this is not bash code, it is definitely C

  3. #3
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,096
    Welcome to the forums!

    Looks like homework to me as well. Unfortunately, homework questions are not allowed on the forums:

    http://www.linuxforums.org/forum/lin...ums-rules.html
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...