Search code examples
windowsbashshellcygwin

Porting BASH scripts between 32 and 64 bit versions of Cygwin.


I have a few simple BASH scripts, written on a 64 bit version of Cygwin.

I would like to port them them to a 32 bit Cygwin on a different PC.

What can I do to make my code run on both 32 and 64 bit versions? I would prefer code that is agnostic.

Here is what my scripts do :

  1. Takes files from current dir and puts them in a specific directory in the C drive
  2. Takes files from a pre-defined directory from C drive and append them in a single file

The main issue I foresee is the Windows naming scheme (for example, there are two "Program Files" and "Program Files (x86)" folders in Windows).

Other than this, are there any actual CODE or CYGWIN related problems that I may face?


Solution

  • I had never to port scripts from 32/64 or vice versa. Also you could ignore the Programm Files (x86) or not thing.

    Porting is important when you have binary code, but not for scripts - except they will do some wired hardware dependend things.

    So nothing to port - you could only make your scrpts a bit more flexible for example having parameters for path or detect in which path they have been installed.