Is there any script to convert sh to csh ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Is there any script to convert sh to csh ?
# 1  
Old 03-30-2012
Is there any script to convert sh to csh ?

Hi All

Is there anyone who have the script to covnert a sh sell script to csh and can share with me?

Thanks a lot!

NickSmilie
# 2  
Old 03-30-2012
Quote:
Originally Posted by nicolast0604
Is there anyone who have the script to covnert a sh sell script to csh and can share with me?

What would you want to do that?
Top Ten Reasons not to use the C shell
Csh problems
Csh Programming Considered Harmful
# 3  
Old 03-30-2012
Quote:
Originally Posted by nicolast0604
Hi All

Is there anyone who have the script to covnert a sh sell script to csh and can share with me?

Thanks a lot!

NickSmilie
Bourne has the ability to open files and read files and redirect file descriptors, csh doesn't. These fundamental operations have no translation.

Bourne can redirect loops too -- csh can't. Again, these fundamental things have no translation.

Bourne has quote operators which conceivably can let you quote nearly anything, csh's horrid quotes are full of special cases. There exist things which simply can't be quoted -- no matter what you do, csh tries to evaluate it as a statement. There's no working equivalent for this basic, indispensable feature.

They are not the same. It's like trying to translate perl into assembly language.

You'd be better off learning the Bourne shell. Any UNIX system has a bourne shell, even csh-happy ones like BSD -- they can't avoid it, too many things need it, and it's mandated by standard. And quite a few UNIX systems don't have csh at all.
# 4  
Old 09-02-2012
Quote:
Is there anyone who have the script to covnert a sh sell script to csh and can share with me?
Yes. Take a look at the sample sh2csh.csh script included with Hamilton C shell. (Google "sh2csh.csh".) It uses a series of sed scripts to do a basic conversion that you can then tweak. It assumes you're using Hamilton C shell, which has a lot of features not the original Unix csh, but I hope it may still be helpful as a starting point. I'm the author, so if you have questions, send me mail or give me a call.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using CSH and need to convert html to PDF

Hi, I am currently using the below code and it throws an error saying badly placed ()'s. I am not sure if this right way to convert html to PDF, please help..I am using C-shell script system ("../html2doc pdf 1000 portrait html$prnfile.html $prnfile.pdf ") print "Content-type:application/pdf... (7 Replies)
Discussion started by: lakers646
7 Replies

2. Shell Programming and Scripting

how to convert from csh to sh

Dear all I am installing some eda software using script. My OS is ubuntu 10.04 and the eda software writing in csh. Since ubuntu reading script file in sh writting. I need someone can help me to convert some definition in script from csh to sh. Below is part of script set archinfo =... (3 Replies)
Discussion started by: tompham
3 Replies

3. Shell Programming and Scripting

Convert .sh to .csh

Hi All, Could any one of you give me a hand to convert the following line of codes from .sh to .csh please ? proc_id=`fuser /tmp/test` if then echo "File is not being used by any thing" fi if then echo "File is being used... please wait" sleep 1 fi Regards. ---------- Post... (1 Reply)
Discussion started by: sraj142
1 Replies

4. Shell Programming and Scripting

Need a script to convert csh to bash

Hi, Can anyone give me a script to convert csh to bash? or any key points which can help me to do so as i am new to it. (3 Replies)
Discussion started by: vineet.dhingra
3 Replies

5. Shell Programming and Scripting

Help with csh script

Ok I asked something similar earlier with no response, so maybe I didn't word it correctly. I'm new at this, so thank you for your help. Here's what I have right now. ---------------------------- > cat MySourceFile #!/bin/csh echo "Please Enter Value For My_Env_Var:" set answer = $< ... (1 Reply)
Discussion started by: MMorrison
1 Replies

6. Shell Programming and Scripting

Convert from Csh to Perl

Hi , I am trying to convert the below code embedded in a csh script to Perl. Can any expert give me some advice on this ? sed -n ''"$start_line"',$ p' $tester_dir/nfiles_extracted.txt|cut -c1-4,6-|/bin/perl $test_summary/compare_for_all _Duts.pl|sort > $tester_dir/nfiles_extracted1.txt (0 Replies)
Discussion started by: Raynon
0 Replies

7. UNIX for Dummies Questions & Answers

How to Convert to CSH File

Hi Everyone, I have a body of code that I'd like to know how to convert to a csh file. In Unix, under a directory, I wish to ls into each of its subdirectories: In Unix prompt I type foreach i(*) foreach? ls $i foreach? end however, when I try to store this body of code in .csh: ... (2 Replies)
Discussion started by: tommms
2 Replies

8. Shell Programming and Scripting

csh failing to call an 2 embedded csh script

I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them) Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Discussion started by: pollsizer
1 Replies

9. Shell Programming and Scripting

how to convert things from csh to sh

i have this method in csh that check for file exist. #check that file exists if ( ! -e $6$5 ) then echo $6$5 Not Found exit 8 endif however i wanted in to be in just sh. so i change the code to: if ; then echo $6$5 Not Found exit 8 fi I get error... (1 Reply)
Discussion started by: forevercalz
1 Replies

10. Shell Programming and Scripting

here-doc convert 2 script convert to single script?

I have my main script calling another script to retrive a "ls -alt" of a directory that's located in a remote location I'm sftping into. main.sh #!/bin/ksh getLS.sh > output.txt getLS.sh #!/bin/sh /home<..>/sftp <host@ip> <<! cd /some/dir/Log ls -alt quit ! Basically I'd like to be... (2 Replies)
Discussion started by: yongho
2 Replies
Login or Register to Ask a Question