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
converting ksh scripts--.bat in window's 2.5lt V8 Windows & DOS: Issues & Discussions 3 11-28-2006 07:23 PM
Converting UNIX scripts to DOS Crozz Windows & DOS: Issues & Discussions 2 11-28-2006 11:33 AM
Converting csv to xls miltony Shell Programming and Scripting 1 12-05-2005 02:08 AM
Converting Text File into XML using Unix Shell Scripts Laud12345 Shell Programming and Scripting 10 02-16-2005 01:35 PM
converting kb to mb csaunders UNIX for Dummies Questions & Answers 1 02-26-2004 04:14 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-27-2007
sherkaner sherkaner is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 9
converting ksh scripts to sh

Hello All,

I have a whole bunch of shell scripts written in a ksh environment and which successfully execute there. However, I found out that they eventually need to be used in a sh environment. So some commands like some_variable=$(some_command) fail because sh doesn't understand $(.....). I identified a list of scripts that have the $(.....) statements. Now I have to replace all those with `.....`

There must be someway I can automate this find and replace action right? Can you please point me in the right direction? Can I use sed for it? If so, what is the exact command? I can identify the statements using the regex '\$(.*)' but I don't know how to replace the command with `...`
I guess I have to parse each line of each file in a loop and do the substitution but I don't know the substituion command.
Thanks in advance for ur help.
 

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 09:40 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