Sponsored Content
Full Discussion: converting ksh scripts to sh
Top Forums Shell Programming and Scripting converting ksh scripts to sh Post 302138064 by sherkaner on Friday 28th of September 2007 11:39:48 AM
Old 09-28-2007
Thanks for the insight and advice porter. Apparently they don't have the xpg4 sh (the scripts simply didn't work in the system). These scripts haven't been tested yet. Someone from testing did rudimentary testing and discovered that the scripts don't work. Now I've got to rectify it. Perhaps, I'll use some start-from-scratch logic like this..

In the algorithm below,
'conv' is used count number of $(..) to convert.
Not sure, if regular parantheses these ever occur (just plain '(....)') . Just realized this. I am not accounting for them. But let me know if you know that regular parathesis do occur. As far as i know i am not using grep statements searching for regular paranthesis in the scripts)

For each file from list of files.
do

Move file to file_ksh

For each line in file_ksh
do


For each character in line
do

if char is $,
if next char is (
conv = conv + 1
replace_char = `
else if char is ) and conv != 0
replace_char = `
conv = conv - 1
else
replace_char=char

Write replace character into line_variable.
done

write line_variable into file

done

done

How does this sound?? I know that its roundabout but I dont know any other way. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting an OpenVms .com to a UNIX ksh script

Does anyone know what a unix equivalent to the following OpenVms string would be? variable1 = F$FAO("!123AS",file_create_time) I can't seem to find the proper syntax of anything I try. Thx! J (1 Reply)
Discussion started by: prosserj
1 Replies

2. Shell Programming and Scripting

Converting Text File into XML using Unix Shell Scripts

Hi everyone, If someone out there could help me out with this problem. I would really appreciate it. I am trying to convert a file into xml format using Unix shell scripts. The file has fields with each field having a certain number of bytes, but the fields are not delimited by anything... (10 Replies)
Discussion started by: Laud12345
10 Replies

3. Windows & DOS: Issues & Discussions

Converting UNIX scripts to DOS

Is there a tool available to convert UNIX (BASH Shell) scripts to DOS scripts? I understand that DOS scripting is far inferior to unix scripting, and therfore this conversion may not be possible. Alternativley, perhaps I could convert my Unix scripts to C... then compile it for a windows... (2 Replies)
Discussion started by: Crozz
2 Replies

4. Windows & DOS: Issues & Discussions

converting ksh scripts--.bat in window's

hi evry one , I did some ksh scripts for file editing in AIX 5.2 ver, issue is while I was trying to run these scripts in windows box as batch files windows is not recognising the awk part of the ksh script,as it is GNU environment, so any one who can help me will be appreciated. this is the... (3 Replies)
Discussion started by: 2.5lt V8
3 Replies

5. Shell Programming and Scripting

HELP WITH .ksh script converting the exit status

Hi Can someone help me please? In a standard UNIX .ksh script, if you have the exit status..say 5...what line do you have to enter into the script for this number to be automatically converted to its actual exit reason by looking up the exit status file...wherever that is? thanks angus (1 Reply)
Discussion started by: angusyoung
1 Replies

6. UNIX for Dummies Questions & Answers

Converting binary file to readable format in Ksh

In Unix/Ksh, when I try to look inside a file it says that the file may be a binary file and if I want to see it anyway. When i say 'yes', it shows me the content filled with unreadable symbols (looks like binary). Is there a command that I can run from the Unix prompt to convert/translate that... (3 Replies)
Discussion started by: arthurs
3 Replies

7. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

8. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

9. UNIX for Dummies Questions & Answers

converting scripts from dos 2 unix format

Hi, I am new to shell scripting and exploring it , I have developed few sample shell script but I have developed them on windows xp notepad and then saving them on folder and then testing them on cywgin and running perfectly...but these scripts are in dos format and I want to convert them in unix... (1 Reply)
Discussion started by: rahul125
1 Replies

10. Shell Programming and Scripting

converting ksh to bash - typeset commands

Hi all, Am trying to convert a script written in ksh to a bash shell. At the moment, am stumped with the typeset -u command and I can't find an equivalent of it in bash. integer function is also not working as is the following if statement if ] && ]; then continue fi Is... (3 Replies)
Discussion started by: newbie_01
3 Replies
SEXP-CONV(1)							   Nettle tools 						      SEXP-CONV(1)

NAME
sexp-conv - convert s-expression to a different encoding SYNOPSIS
Conversion: sexp-conv [OPTION]... < INPUT-SEXP Fingerprinting: sexp-conv --hash[=algorithm] [OPTION]... < INPUT-SEXP DESCRIPTION
This manual page documents briefly the sexp-conv command. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. Instead, it has documentation in the GNU Info format; see below. sexp-conv is a program that converts S-expressions. It automatically detects the s-expression syntax variant of the input. It is primarily used by the `lsh' packages, which stores keys and most other objects on disk in that format, but may be of other use as well. OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. For a complete description, see the Info files. --hash=algorithm Output only the hash of the s-expression, using algorithm (default: sha1). --raw-hash Alias for --hash, for compatibility with lsh 1.x. --once Process exactly one s-expression. --spki-hash Output an SPKI hash for the object. Not yet implemented. -s, --syntax=format Variant of S-expression to output. Valid S-expression formats are: transport, canonical (binary), advanced, and hex (same as advanced, but numbers in hex instead of base64). -w, --width=width Limit output to lines of width characters (has no effect on canonical syntax). Zero means no limit. -?, --help Show summary of options. -V, --version Show version of program. SEE ALSO
ssh-conv(1), lsh(1), lshd(8), http://theworld.com/~cme/spki.txt. The programs are documented fully by the sexp section under the Getting Started header of the lsh info page, available via the Info system. BUGS
This program should be documented in the nettle manual, not in the lsh manual. AUTHOR
This manual page was originally written by Timshel Knoll <timshel@debian.org>, for the Debian GNU/Linux system (but may be used by others). Edited by Magnus Holmgren <magnus@kibibyte.se>. nettle 1.15 June 2007 SEXP-CONV(1)
All times are GMT -4. The time now is 03:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy