Portable scripting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Portable scripting
# 1  
Old 11-27-2007
Portable scripting

Quote:
Originally Posted by bakunin
"How to achieve a maximum of standardization while at the same time recognizing newer developments in the Unix systems programming area?"
For historical, simple, practical and portable reasons my scripts start normally with "#!/bin/sh", hence I restrict myself to those features available in the Bourne Shell.

The few cases where I would use ksh or bash is if I know this script is targetted at some subset of platforms where that is available and required for the job. If it's not required, then back to good old sh.

I also use "test" rather than [ or [[ as I like to see blatently what a script is really doing. Ie, my model is that

Code:
"if" uses it's arguments as a command line and will use the 
then or else clause depending on zero or non zero 
return code of that command.

hence I am more than happy to use "if" with many other programs, not just test or some link to it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Is There a Portable Way to Kill a Process in C++

Hi. I am looking for a way to write C++ code that will kill a process, and works just the same way in both Unix and Windows. For my particular situation, it cannot be hundreds of lines of code, either. Thanks in advance for any light you can shed on this. Brandon (5 Replies)
Discussion started by: BrandonShw
5 Replies

2. UNIX and Linux Applications

urgent help in Portable Applications

Hello Im stuck with a project on converting existing applications in to their portable versions, What i mean is that i want an application to run on a Linux OS without the need of actually installing the application on that machine. My preffered OS is fedora as it is used on most machines in my... (1 Reply)
Discussion started by: engineeringme
1 Replies

3. Linux

Portable Applications

Hello Im stuck with a project on converting existing applications in to their portable versions, What i mean is that i want an application to run on a Linux OS without the need of actually installing the application on that machine. My preffered OS is fedora as it is used on most machines in my... (1 Reply)
Discussion started by: engineeringme
1 Replies

4. UNIX for Advanced & Expert Users

Urgent help in portable applications

Hello Im stuck with a project on converting existing applications in to their portable versions, What i mean is that i want an application to run on a Linux OS without the need of actually installing the application on that machine. My preffered OS is fedora as it is used on most machines in my... (1 Reply)
Discussion started by: engineeringme
1 Replies

5. Programming

urgent help in portable applications

Hello Im stuck with a project on converting existing applications in to their portable versions, What i mean is that i want an application to run on a Linux OS without the need of actually installing the application on that machine. My preffered OS is fedora as it is used on most machines in my... (0 Replies)
Discussion started by: engineeringme
0 Replies

6. Linux

A portable bootable version?

What I have been doing for some time now is installing linux on my tech machine at work, plugging in devices and transferring data with dd_rescue. What I need now is a version of linux that I can install on a laptop sata hard drive and be able to plug it into any machine to transfer data off of... (1 Reply)
Discussion started by: Methal
1 Replies

7. UNIX and Linux Applications

ClamAV/other AV. Possible to make portable?

Hey guys/gals, I work with a large amount of servers, and was just curious if it is possible to make a linux AV app, portable. What i mean is, I go to a user's home directory and do something like ./clamavscan (I suppose an alias for clamscan..), and it scans the user's home directory for... (2 Replies)
Discussion started by: Rhije
2 Replies

8. Shell Programming and Scripting

Query regarding portable script

Dear Experts, I want to write a script which has to work on Solaris & Linux sytems. The problem which i am facing is, there are commands whose options are different on both OS's. For example ping. On Solaris i have to write: ping $host 1 to check if the host is alive On Linux i... (4 Replies)
Discussion started by: dhiraj4mann
4 Replies

9. Linux

Apache Portable Runtime

Hi I am starting a project in which I want to use APR for portability. I download APR version 1.2.2 from "http://apr.apache.org/download.cgi#apr1" and I am using Redhat/Linux 9. As I am a newbie to APR and I have no prior experience of using APR, so I started learning it from:... (0 Replies)
Discussion started by: sumsin
0 Replies

10. Windows & DOS: Issues & Discussions

Portable GUI shell scripting?

I have some scripts that run in Windows, and the ability to put a GUI layer over them is kind of appealing. So when I stumbled over http://wizapp.sourceforge.net/ I thought that was rather cute. (Reading the "advanced batch scripting" art of the manual impresses upon me that no sane person... (2 Replies)
Discussion started by: luke
2 Replies
Login or Register to Ask a Question