Sponsored Content
Full Discussion: Portable scripting
Top Forums Shell Programming and Scripting Portable scripting Post 302147609 by porter on Tuesday 27th of November 2007 09:54:18 PM
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.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
TWILL(1)							  [FIXME: manual]							  TWILL(1)

NOM
twill-sh - a simple scripting language for Web browsing SYNOPSIS
twill-sh [option] [script(s)] DESCRIPTION
Twill is a simple language that allows users to browse the Web from a command-line interface. With twill, you can navigate through Web sites that use forms, cookies, and most standard Web features. twill-sh lets you interactively browse the Web. OPTIONS
--help/-h print usage information --version/-v Show version information and exit --quiet/-q Do not show normal output --interactive/-i Drop into an interactive shell after running files if any --fail/-f Exit on first file which fails --never-fail/-n Continue executing scripts even if errors occur --url/-u URL Start at the given URL before each script SEE ALSO
twill-fork (1). AUTHORS
Twill was written by C. Titus Brown titus@idyll.org and This manual page was written by Arnaud Fontaine arnau@debian.org for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. COPYRIGHT
Copyright (C) 2007 Arnaud Fontaine [FIXME: source] april 10, 2007 TWILL(1)
All times are GMT -4. The time now is 06:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy