removing bashisms/install dash on cygwin?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting removing bashisms/install dash on cygwin?
# 1  
Old 08-14-2008
removing bashisms/install dash on cygwin?

I would like to write unix shell scripts which are strictly POSIX compliant, and do not use any specific functionality that ties them down to one particular shell.

What is the best way to do this?

Any script or program that can be run to determine strict POSIX compliance?

Or should I make sure that all my scripts work with dash
Debian Almquist shell - Wikipedia, the free encyclopedia
which I understand offers minimal functionality above POSIX?

And if dash is the best route, does anyone know how to install it underneath cygwin?
# 2  
Old 08-14-2008
well. this is a huge problem you are traing to tacle here ....
the best aprouch is the one that the people of bigbrother did (the system monitor)
they use a config script that source alot of things.
their main scripts source that oconfiguration and work on.
so you ony have to make sure the config script is kinda good.

for example, in during the isntalationm, if you tell the script you are on linux, it creates a var in the config called AWK that points to gawk
in their scripts, for all platforms, you use $AWK regardless
# 3  
Old 08-14-2008
Using the --posix flag in bash would seem like a simple and straightforward first step.
# 4  
Old 08-14-2008
Quote:
Originally Posted by fabulous2
I would like to write unix shell scripts which are strictly POSIX compliant, and do not use any specific functionality that ties them down to one particular shell. What is the best way to do this?
If you really want to write UNIX shell scripts which are strictly POSIX compliant, the first question you need to answer is which version of the relevant POSIX standards do which to conform to. The original versions were POSIX.2-1992 (Shell and Utilities) and POSIX.2a-1992 (Interactive shell and Utilities). The latest version is IEEE Std 1003.1, 2004 (POSIX.1-2004) which includes POSIX.2 and various amendments.

Quote:
Any script or program that can be run to determine strict POSIX compliance?
There are various test suites available (VSC/PCTS) but they generally test the shell for conformance to a specific version of a standard rather than test that a script is strictly POSIX conformant.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

A dash to GOTO or a dash from GOTO, that is the question...

Well, guys I saw a question about GOTO for Python. So this gave me the inspiration to attempt a GOTO function for 'dash', (bash and ksh too). Machine: MBP OSX 10.14.3, default bash terminal, calling '#!/usr/local/bin/dash'... This is purely a fun project to see if it is possible in PURE... (3 Replies)
Discussion started by: wisecracker
3 Replies

2. Windows & DOS: Issues & Discussions

Interrupted Cygwin install changed permissions on C drive

I was installing cygwin on my Windows 7 desktop. I guess I picked a bad mirror site because the download speed was very slow and it wasn't able to give me all the packages I wanted. I closed the setup in too much haste. I think it was still downloading and not yet installing though. It said that... (1 Reply)
Discussion started by: ethoma7329
1 Replies

3. Shell Programming and Scripting

opening new instance of cygwin from withing cygwin

I'm using cygwin on win7, What I would like to do is something like this: cygstart cygwin tail -f /foo/test.log | perl -pe 's/error/\e I know I can start a new instance using either of these: mintty -e ... cygstart tail ... But neither of those open in ANSI mode, so I can't do... (0 Replies)
Discussion started by: Validatorian
0 Replies

4. UNIX for Dummies Questions & Answers

Trying to install UCSF DOCK on Cygwin

I'm trying to install DOCK 6.3 on my computer. I'm using the latest version of both DOCK for the install and Cygwin. Following the directions outlined here DOCK 6.3 User Manual I type in the prompt ./configure Makefile and it creates a header file titled config.h I then type in make... (6 Replies)
Discussion started by: newuser1
6 Replies

5. UNIX for Dummies Questions & Answers

Cygwin/X install help

Hi All, Not sure if this is the right forum but hope someone has the answer. I installed Cygwin/X and usually use the 'startxwin.bat' to start xwin. However, I recently updated to Windows 7 and noticed that 'startxwin.bat' is not in the normal path (normally its in /usr/X11/bin). Anyone know... (1 Reply)
Discussion started by: ScKaSx
1 Replies

6. UNIX for Advanced & Expert Users

Install ksh93 for cygwin

Hi, Does anyone know where can I get ksh93 for installation on CYGWIN. Thanks? (1 Reply)
Discussion started by: devtakh
1 Replies

7. UNIX and Linux Applications

How to install IBM db2 database server in cygwin ??

Hi folks, I am looking for a clue to install db2 in cygwin.....kindly help.;) (0 Replies)
Discussion started by: frozensmilz
0 Replies

8. UNIX for Dummies Questions & Answers

How to install Cygwin on Windows XP SP2

Please can anyone help me with how to install cygwin on a windows Xp SP2 platform, I cant seem to get it to work? (1 Reply)
Discussion started by: jimoney
1 Replies

9. Windows & DOS: Issues & Discussions

cygwin-x/can't install xorg-x11-f100 & xorg-x11-fnts

Hello All. Really a newbie to Linux/Unix. Trying to get into Linux. Using XP PE currently. Installed cygwin and trying to intall cygwin-x. Everything else is setup nice but i can't seem to install these two packages (without whom xwin won't start) 1. xorg-x11-f100 2. xorg-x11-fnts Tried the... (1 Reply)
Discussion started by: binodbdrchand
1 Replies

10. UNIX for Dummies Questions & Answers

CYGWIN/CPAN install of Expect.pm

I am attempting to install a Perl Expect module via the CPAN . CPAN goes through the process but nothing happens, sample perl scripts can not find the Expect Module. CPAN was configured via the Default process " Are you ready for manual configuration? " answered "no". CPAN install seemed to find... (1 Reply)
Discussion started by: white222
1 Replies
Login or Register to Ask a Question