Sponsored Content
Top Forums Shell Programming and Scripting To make my script multi-os compatible Post 302843061 by wisecracker on Monday 12th of August 2013 03:10:51 AM
Old 08-12-2013
The code is not there so a few pointers...

1) Never make assumtions without quoting them and/or investigating them.
2) Do NOT take directory/folder/drawer trees as being identical on all the platforms.
3) Obtain units with default installs of the OSes you want to test with.
4) Check that the shell you want to use exists. Most Linux installs and the Macbook Pro default to bash.
5) Try to make your code backwards compatible - seriously difficult in Python.
6) If you are doing something odd inside the Terminal, (colours for example), ensure that the Terminals can handle them.
7) Ensure that any _commands_ you use exist and have the arguments you need; for example "stat -c ........" does not work on this Macbook Pro as the -c argument does not exist.
8) If you are not sure ask a Forum like this one to try out a command with the arguments you need on their platform of choice. There are people willing to help as it is a learning curve for them too.
9) Can't think of anything else at the moment. ;o)
10) Oh, and I am an amateur coder, I code to work first not work to code, but once working I will ask for help in speeding up any routines...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

multi-file multi-edit

Good day! I am trying to learn how to use the "sed" editor, to perform multiple edits on multiple files in multiple directories. I have one script that tries to call up each file and process it according to the edits listed in a second script. I am using a small input text to test these, at... (12 Replies)
Discussion started by: kielitaide
12 Replies

2. Shell Programming and Scripting

multi loop script

I need to run a process a large number of times. In /home/runx, I have process X, which accesses a file X.ini. X.ini contains 3 variables, as follows : X_date=ccccmm X_location=aaa X_type= t where date will be 200501 thru 200611 location will be aaa, bbb, ccc, or ddd type ... (2 Replies)
Discussion started by: grinder182533
2 Replies

3. Shell Programming and Scripting

Howto make ksh skript bash-compatible with backticks

I have the following ksh-script: #!/bin/ksh # Ueberprüfe, ob genau ein Parameter angegeben wurde test "$#" -eq "1" || { echo "USAGE: path_cleanup <PATH_NAME>"; return 1; } # Ueberpruefe, ob awk und nawk installiert sind test -x /bin/nawk || { echo "ERROR: nawk is not installed"; return 1;... (2 Replies)
Discussion started by: doc_symbiosis
2 Replies

4. Linux

How to make multi os installatin DVD

i want to make an install dvd with os's Wiun xp redhat Linux 5 i tried with MagicISO but after making always says redhat checksome error while checking created ISO file in VMWARE Workstation and Microsoft virtualpc... (2 Replies)
Discussion started by: seshumohan
2 Replies

5. Shell Programming and Scripting

Multi line variable script... needs help.

I am trying to write a script that will help me put a file into excel with little manipulation. Below is a sample of the file im using. Group1:*:gid1:user,user Group2:*:gid2:user,user Group3:*:gid3:user,user,user,user,user,user,user Group4:*:gid4:user,user I marked in red the part that is... (1 Reply)
Discussion started by: rookieuxixsa
1 Replies

6. Shell Programming and Scripting

Multi level sorting script

I want to sort like below Suppose few lines in a file is like this systemid:ABC messagedestination:batchxpr replytoqname: myca systemid:BCD messagedestination:realtime replytoqname: myca systemid:ABC messagedestination:realtime replytoqname: eac systemid: BCD messagedestination:mqonline... (1 Reply)
Discussion started by: srkmish
1 Replies

7. Shell Programming and Scripting

Script Help - Multi Comands

Hi guys I am trying to get a bunch of lines into a .sh script that will let me easily run a bunch of commands on its own without me having to be there... I have done this with other things but apparetnly it doesn't like to use yum.. I will post my script you will see what im trying to do.. ... (3 Replies)
Discussion started by: Bigstack
3 Replies

8. Shell Programming and Scripting

How to substract selective values in multi row, multi column file (using awk or sed?)

Hi, I have a problem where I need to make this input: nameRow1a,text1a,text2a,floatValue1a,FloatValue2a,...,floatValue140a nameRow1b,text1b,text2b,floatValue1b,FloatValue2b,...,floatValue140b look like this output: nameRow1a,text1b,text2a,(floatValue1a - floatValue1b),(floatValue2a -... (4 Replies)
Discussion started by: nricardo
4 Replies

9. Programming

Multi head/multi window hello world

I am trying to write a large X app. I have successfully modified my xorg.conf to setup 4 monitors on an NVIDIA Quatro5200. I am trying to modify a simple hello world application to open a window on three of the four monitors. depending on the changes to loop the window creation section and event... (2 Replies)
Discussion started by: advorak
2 Replies

10. Shell Programming and Scripting

Script multi listener

hello can help to script to find the listener is up or down for diferent db i have 2 listener ps -fea |grep tns root 17333 17559 0 12:26:38 pts/3 0:00 grep tns oracle 3800 1 1 Jul 23 ? 400:42 /u01/app/oracle/product/9.2.0/bin/tnslsnr LISTENER -inherit ... (1 Reply)
Discussion started by: ceciaide
1 Replies
wsreg_add_compatible_version(3WSREG)		    Product Install Registry Library Functions		      wsreg_add_compatible_version(3WSREG)

NAME
wsreg_add_compatible_version, wsreg_remove_compatible_version, wsreg_get_compatible_versions - add or remove a backward-compatible version SYNOPSIS
cc [flag ...] file ...-lwsreg [library ...] #include <wsreg.h> int wsreg_add_compatible_version(Wsreg_component *comp, const char *version); int wsreg_remove_compatible_version(Wsreg_component *comp, const char *version); char **wsreg_get_compatible_versions(const Wsreg_component *comp); DESCRIPTION
The wsreg_add_compatible_version() function adds the version string specified by version to the list of backward-compatible versions con- tained in the component specified by comp. The wsreg_remove_compatible_version() function removes the version string specified by version from the list of backward-compatible ver- sions contained in the component specified by comp. The wsreg_get_compatible_versions() function returns the list of backward-compatible versions contained in the component specified by comp. RETURN VALUES
The wsreg_add_compatible_version() function returns a non-zero value if the specified backward-compatible version was successfully added; otherwise, 0 is returned. The wsreg_remove_compatible_version() function returns a non-zero value if the specified backward-compatible version was successfully removed; otherwise, 0 is returned. The wsreg_get_compatible_versions() function returns a null-terminated array of char pointers that represents the specified component's list of backward-compatible versions. If the specified component has no such versions, NULL is returned. The resulting array and its con- tents must be released by the caller. USAGE
The list of backward compatible versions is used to allow components that are used by multiple products to upgrade successfully without compromising any of its dependent products. The installer that installs such an update can check the list of backward-compatible versions and look at what versions are required by all of the dependent components to ensure that the upgrade will not result in a broken product. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
prodreg(1M), wsreg_initialize(3WSREG), wsreg_register(3WSREG), wsreg_set_version(3WSREG), attributes(5) SunOS 5.10 22 Sep 2000 wsreg_add_compatible_version(3WSREG)
All times are GMT -4. The time now is 10:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy