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
pushd and popd sharanbr UNIX for Dummies Questions & Answers 4 11-14-2007 05:34 AM
pushd popd owijust Shell Programming and Scripting 1 01-06-2006 12:28 AM
pushd? Fwurm UNIX for Dummies Questions & Answers 3 11-05-2001 10:22 AM
Irix 5.3 Trixee High Level Programming 3 10-17-2001 11:45 AM
Irix DPAI UNIX for Dummies Questions & Answers 7 08-30-2001 01:53 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-11-2003
jbalster jbalster is offline
Registered User
  
 

Join Date: Dec 2003
Posts: 2
pushd/popd missing on SGI irix 6.5.11

I know that pushd/popd are built into csh, but I'm trying to run a set of 3rd party make files that use sh.

My problem is that sh simply squawks that pushd and popd are not found, then the make dies due to the error.

I've searched the entire system, and they are indeed missing. Evidently SGI forgot about sh needing them, and must have yanked them with this release of IRIX(6.5.11m).

I tried the SGI web site and I cannot locate them. I also tried contacting SGI and they are less than helpful.

I'm looking for the source for those 2 utilities so that I can compile and install them. It doesn't have to be the exact source, just a close enough approximation to do a simple 'pushd <dir>'; <series of commands>; popd. I thought I'd ask if anyone had the source available before I go and try to write them from scratch.

Thanks for any assistance you can offer!!!
  #2 (permalink)  
Old 12-11-2003
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
As a stop gap solution, you can download a demo version of the Hamilton C shell which, according to their site, is a complete recreation of the UNIX c shell but with added utilities such as popd, and pushd. Hamilton C Shell Link The full version is 350 bucks to buy
  #3 (permalink)  
Old 12-11-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
This does not make sense. pushd and popd must be built into the shell to be of any real use. They must be builtins for the same reason that cd must be a builtin. Of course, posix senselessly mandates an external version of "cd", so most verdors have that, but the only examples of its use are highly contrived.

Depending on which version of sh you have, you may have one or more of the two favors of functions available. If so, pushd and popd can probably be implemented as functions, but the code for the functions would be in your script

This is a snap in ksh, and the korn shell book gives an implemention.

Are you sure that the make files really want to use sh? Try this:
SHELL=/usr/bin/csh make
  #4 (permalink)  
Old 12-11-2003
jbalster jbalster is offline
Registered User
  
 

Join Date: Dec 2003
Posts: 2
Thanks, I think I can use alias

Thanks for the idea. I forgot that when a process terminates, that it's context gets lost, so it doesn't matter if it did a 'cd' or not.

It's really surprising to me that the pushd and popd commands aren't working in sh.

I have tried to create the following aliass

$ alias pushd=cd
$ alias popd="cd -"

but these only work if I interactively type in the commands after starting sh

running make, starts a new sh, and then the aliases are gone.

I tried adding these to .profile but it does not seem to run that file. I put an
echo "Hi from .profile"
into the .profile and I dont' get that either.

The man sh page does not show any other files than
$HOME/.profile
being used by sh, but I don't see when that one gets used. Maybe it's used at login time if sh happens to be your login shell, but my login shell is tcsh
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0