New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: Retha McClure

ComputerSystemsII CSC2405

Retha McClure
GPA 3.74


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 5 page Class Notes was uploaded by Retha McClure on Wednesday October 28, 2015. The Class Notes belongs to CSC2405 at Villanova University taught by Damian-Iordache in Fall. Since its upload, it has received 11 views. For similar materials see /class/230573/csc2405-villanova-university in ComputerScienence at Villanova University.


Reviews for ComputerSystemsII


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/28/15
CSC 2405 Running New Programs in UniX Exercise 1 Running ls with execl exec1c I include ltstdiohgt include ltunistdhgt include ltsystypeshgt int main iffork O execl binls ls l O waitNULL printf nList completed n return 0 Compile gcc o execl exec1c Run exec1 Output Exercise 2 Running ls with execv exec2c l include ltstdiohgt include ltunistdhgt include ltsystypeshgt int main char cmd3 binls l O char cmd3 cmd0 binls cmd1 l cmd2 O iffork O execlcmd0 cmd waitNULL printf nList completed n return 0 Compile gcc o exec2 exec2c Run exec2 Output Same Exercise 3 Running ls with execlp Try echo PATH at the shell prompt You will see a list of directories search paths separated by 39 This is where the shell looks for a command you type in Unlike execl and execv that require the full path for a command execlp and execvp search these directories for the command you specify as a first argument exec3 c I include ltstdiohgt include ltunistdhgt include ltsystypeshgt int main 0 l iffork O execlp ls ls l O not binls waitNULL printf nList completed n return 0 Compile gcc o exec3 exec3c Run execl shah Output Same Exercise 4 Running Another Program exec4c execu rable exec4 ateStc l execufoble atest int main int mainint argc char argvD pid fork printf Got a s argvl ifltpid gt printf Child runsn exec1 atest atest dog 0 printf Child donen else waitNULL printf Parent donen a If execl succeeds who is The ou l39pu l39 of exec4 b If execl fails who is The ou l39pu l39 of exec4 c Why would execl fail Exercise 5 Running wc on Multiple Files The word counT program we can Take as argumenT a file whose name is specified in The command line For insTance The Unix command wc L filename will prinT ouT The number of lines in The file wiTh name filename WriTe a small program ThaT Takes any number of file names as command line parameTers For each filename The program should creaTe a child process which a prinTs ouT The name of The file b uses execlp To execuTe The program we Lquot on ThaT file The parenT process should noT exiT unTil all processes have eXiTed exec5c int mainint argc char argv int i fori O i lt argc i l if fork l l printf sn argvi execlp wc WC L argvi O exit1 fori O i lt argc i waitNULL


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.