The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Carreer:Networking Programming in Unix (C programming Language) vibhory2j UNIX for Dummies Questions & Answers 5 2 Days Ago 04:57 PM
Unix Systems Programming Vs Unix Programming BCarlson Shell Programming and Scripting 0 05-24-2006 11:34 AM
programming question... sorta 01000101 UNIX for Dummies Questions & Answers 2 05-17-2006 04:14 AM
programming question from a newbie, please help milenky High Level Programming 1 10-11-2002 07:15 AM
Question about Shell Programming IMPORTANT Shell Programming and Scripting 3 03-26-2002 12:22 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-23-2000
Registered User
 

Join Date: Sep 2000
Location: MD
Posts: 2
All right I am currently writing a c function in unix... and is trying to create a child shell to execute various command along with its arguments such as

ls

cd "directory name"

yeah it is a bit redundant, but I am just beginning and this seemed like a good exercise


but for some reason every command work except for my

cd command....

no matter what I remain in the root directory instead of going to the destrination directory....

I am using execvp if I successfully create a fork... and have the parent pid wait until the child pid has finished it functions before proceeding....

I am guessing so far now is that whenever I close the child directory, any non-permanent (such as mkdir) are ignored as I close that child thread and open a new one....

again I am only guessing at this... is there anyone who might see me through this.... Thanks....
Forum Sponsor
  #2 (permalink)  
Old 09-23-2000
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 4,191
Lightbulb

You might consider looking at your environmental variable
and how they are passed to the child process. For example,
the child process may read the environmental variables
during the fork/exec process. If they do and you have
not set them correctly, the old environmental variables
may be used. This could be causing your grief

[Edited by Neo on 09-25-2000 at 02:47 PM]
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0