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
Accessing variables of one shell script in another shell script rsendhilmani Shell Programming and Scripting 2 03-17-2009 01:17 AM
Accessing PL/SQL OUT variables in Korn Shell Script bright_future UNIX for Advanced & Expert Users 4 12-02-2008 12:02 PM
Accessing variables of one shell script in another shell script looza Shell Programming and Scripting 2 06-30-2008 08:13 PM
Accessing the parameters of a shell script The Observer Shell Programming and Scripting 2 06-20-2008 10:09 AM
Accessing var from .profile into shell script videsh77 Shell Programming and Scripting 7 05-28-2005 01:21 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 07-18-2008
cooldude cooldude is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 44
Is there a way to send the command to the shell where the script is being executed?
  #2 (permalink)  
Old 07-18-2008
cooldude cooldude is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 44
I've dozens of aliases defined. I don't want to create a script for each of them.
But here's what I trying to do. I'm writing a script that runs commands in a sequence. If one of the commands throw an error, the next commands are not executed. I've wrote a Python script that is called the following way:
$ script "command1 ; command2; command3"
Some of those commands can be aliases. Is there a way to do this without writing a script?
I'd still like to know if the command can be ran in the environment where the script was executed, though.
  #3 (permalink)  
Old 07-18-2008
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,365
Quote:
Originally Posted by cooldude View Post
I've dozens of aliases defined. I don't want to create a script for each of them.
As the bash man page says:
For almost every purpose, aliases are superseded by shell functions.
If you are using bash, you can export functions. I don't know if that would work in this case.
Quote:
But here's what I trying to do. I'm writing a script that runs commands in a sequence. If one of the commands throw an error, the next commands are not executed.
Use a shell script.
Quote:
I've wrote a Python script that is called the following way:
$ script "command1 ; command2; command3"
Some of those commands can be aliases.
No, they cannot be aliases.
Quote:
Is there a way to do this without writing a script?
I'd still like to know if the command can be ran in the environment where the script was executed, though.
Only if you write a shell script instead of a python script.
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 07:52 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