The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bourne Shell script - log for users loggin on and off noodlesoup Shell Programming and Scripting 14 09-08-2006 11:30 PM
Bourne: How to invoke an alias from within a shell script techshots Shell Programming and Scripting 2 06-04-2006 01:38 AM
Bourne Shell Script dmhonor914 UNIX for Dummies Questions & Answers 2 12-10-2003 12:25 PM
bourne shell script psrinivas Shell Programming and Scripting 2 12-06-2001 03:38 PM
Bourne shell script need help please ? dezithug UNIX for Advanced & Expert Users 7 10-24-2001 02:59 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 05-23-2006
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,246
Quote:
Originally Posted by System Shock
While I don't understand exactly why you need a script to issue a cd command, why just not create an alias? As in


Code:
 alias 'cdv=cd /des/proj/$1'

If you read the thread you will see that the question relates to bourne shell, bourne shell does not have aliases.
  #2 (permalink)  
Old 05-24-2006
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,808
Do you want the user to exit your script and be in the correctory directory?

Then source your script. ie., (note the leading dot)

Code:
. /path/to/script.sh

If you are invoking shells ie.,
the first line is
Code:
#!usr/bin/sh

then this idea will not work because everytime the user calls the script he execs another shell. Get rid of it. In a sourced script you also should not call exit at the end of the script.
  #3 (permalink)  
Old 05-24-2006
System Shock's Avatar
System Shock System Shock is offline Forum Advisor  
Registered User
  
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 521
Quote:
Originally Posted by reborg
If you read the thread you will see that the question relates to bourne shell, bourne shell does not have aliases.
If you read the title you will see that the question relates to a bourne shell SCRIPT. I suggested an alias in the users' environment, not in the script. I have no idea what other users use as login shells. Why would I suggest set an alias in a script to begin with, especially when, even if the script was ksh or csh, it would do what he wants???
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 11:47 AM.


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