From: utzoo!decvax!harpo!floyd!cmcl2!philabs!sdcsvax!sdcattb!phonlab!sdcsla!warner Newsgroups: net.general Title: help on $cdpath Article-I.D.: sdcsla.180 Posted: Tue Dec 21 16:16:57 1982 Received: Fri Jan 21 08:34:55 1983 I am trying to access the login shell's variable $cdpath ... without success. The relevant code fragment is below. I'v tried about every combination of ("csh -t echo $cdpath) etc. with all the combinations of ' " and ` that I can think of. No luck. I can call my program with $cdpath as an argument but I don't want to. Any suggestions besides giving up programming. Ken Warner ...ucb!sdcsvax!sdcsla:warner or net.followup -------------------------------------------------------------------- FILE *pwd, *popen(); char cdpath[128],curdir[128]; if ((pwd = popen("echo $cdpath","r")) == NULL) { printf("can't open pwd\n"); exit(1); } fgets(cdpath,128,pwd); pclose(pwd); cdpath[strlen(cdpath) - 1] = '\0'; printf("cdpath = %s\n",cdpath); exit(1);