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
How to set a label/number for a function in a shells script lalitka UNIX for Advanced & Expert Users 3 11-04-2008 11:29 AM
script to run different shells which run different processes mochi UNIX for Advanced & Expert Users 2 06-15-2006 01:25 PM
Validating variables in shells script DeepakXavier Shell Programming and Scripting 1 09-23-2005 11:32 AM
Shells dino_leix UNIX for Advanced & Expert Users 3 06-08-2005 07:07 AM
Build script for all shells vino Shell Programming and Scripting 9 04-14-2005 01:25 AM

Reply
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-16-2009
sanjay1979 sanjay1979 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 36
Using different shells in one script

Hi,

Is it possible to use multiple shells in one script.
There are sometimes we need to club shell specific commands in single script.
for example in bash mode we use -e with echo to use Escape sequence but in ksh it is not required. How to tell a UNIX command to run in a specific shell.

Please help.

Regards
  #2 (permalink)  
Old 07-16-2009
kodak kodak is offline
Registered User
  
 

Join Date: Jun 2003
Posts: 51
You can do something like:

#!/bin/ksh
some
ksh
commands
/bin/bash -c "echo -e this or that"

if I'm following you correctly.

Most shells have a -c (or similar) option.
  #3 (permalink)  
Old 07-16-2009
sanjay1979 sanjay1979 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 36
Hi Kodak,

Dear still it is not working. I tried with simple one. On ksh I tried following command -
ksh> /bin/bash -c echo -e "first\nsecond"

but it does not give any output.


Regards
Reply

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 06:23 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