The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
bash. convert mpeg adts to normal mp3 stahoo23 Shell Programming and Scripting 6 03-13-2009 05:44 AM
what are some different commands in c shell and korn shell?? EquinoX UNIX for Dummies Questions & Answers 1 01-29-2008 12:14 AM
bourne shell or korn shell? XZOR UNIX for Dummies Questions & Answers 2 10-06-2006 02:34 AM
How to Convert scientific notation to normal ? maheshsri Shell Programming and Scripting 2 01-05-2006 01:33 PM
KORN Shell - Spawn new shell with commands frustrated1 Shell Programming and Scripting 2 04-20-2005 02:23 PM

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

Join Date: Sep 2005
Posts: 74
how to convert from korn shell to normal shell with this code?

well i have this code here..and it works fine in kornshell..

#!/bin/ksh
home=c:/..../
input=$1
sed '1,3d' $input > $1.out

line=""
cat $1.out | while read a
do
line="$line $a"
done

echo $line > $1

rm $1.out

however...now i want it just in normal sh mode..how to convert this? any help? thanks!
  #2 (permalink)  
Old 11-22-2005
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
Quote:
Originally Posted by forevercalz
well i have this code here..and it works fine in kornshell..

#!/bin/ksh
home=c:/..../
input=$1
sed '1,3d' $input > $1.out

line=""
cat $1.out | while read a
do
line="$line $a"
done

echo $line > $1

rm $1.out

however...now i want it just in normal sh mode..how to convert this? any help? thanks!
could you define what you mean by 'normal' sh, pls?

and if you had run it under your 'normal' sh, what kind of issue you encountered?
  #3 (permalink)  
Old 11-22-2005
forevercalz forevercalz is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 74
oh its bourne shell as in #!/bin/sh
  #4 (permalink)  
Old 11-22-2005
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
Quote:
Originally Posted by forevercalz
oh its bourne shell as in #!/bin/sh
ok, so. when you run it under '/bin/sh' ... what's taking place?
  #5 (permalink)  
Old 11-22-2005
forevercalz forevercalz is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 74
well....its this part i guess...or maybe other part of the lines...as im a newbie..what i think was this line that cause the error....
cat $1.out | while read a
do
line="$line $a"
done

the line will not combine...as in the code here "$line Sa" will not execute
  #6 (permalink)  
Old 11-23-2005
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
Quote:
Originally Posted by forevercalz
its this part i guess...
cat $1.out | while read a
do
line="$line $a"
done

the line will not combine...as in the code here "$line Sa" will not execute
what do you get as the output?

could you post the content of your '$1' file, pls?
  #7 (permalink)  
Old 11-23-2005
forevercalz forevercalz is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 74
ok..my output was something similar to this..
abc

abc

abc

and when i run this ...i will get
abc abc abc...

i can get this in korn shell ..but not in bourne..dun know why,,
Sponsored Links
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:50 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