Assistance with parsing large no of bash scripts through Windows cleanse? Works in cmd

Recommended Posts

DigitalFacade82 3

DigitalFacade82 3

I am fairly new here at AutoIT forums. I have read a bit in here and been a serial lurker for quite sometime now. I am still not confident with all of the AutoIT stuff but have a general understanding of Windows command line which has helped.

The situation I am in is that I am currently using Cygwin for development work in Android. I use this to connect to Elcipse and Github. I had a full functioning Cygwin up until I merged in the WinGIT install for Cygwin/Ming that totally r*%^ed things (excuse the pun) badly, namely because idiots don't know how to clean their scripts before uploading them saying that they work in Cygwinshell for Windows when quite obviously they wrote them in Bash shell in Linux and just "thought" that they would work. A massive problem is line endings between Windows and Linux, and that is no problem if you set your editing environment up correctly to begin with. Anyway that cannot be solved now. What I usually do to bypass this is run some scripts to clean the bash script (be it an executable bash script or .sh it doesn't really matter).

Some backgroung here are the scripts that I run normally to complete the task from within Command prompt (yes it works from command prompt so it should work in AutoIT right?)
Note that the AutoIT script will be a Binary executable (compiled) and be located in the Cygwin bin directory.

Situated in the same directory directly next to the cmd script is a bash script with the same name clean.sh
Note: I have since learned that most executables for Cygwin can actually be executed from the command line in Command prompt and especially easy if they are run from within the bin directory!

Because these guys that made the WinGIT right royally screwed my clean working Cygwin with all of stuff working and I do need to have GIT working aswell I kind of need to pass all the bash scripts through the cleaning mill. That was ok, I started with the first one initialize and then that worked so I went on to the next one, and then I thought? "Hey how many bash scripts are there in Cygwin anyway?" And then I nearly fainted .....after doing a *.sh search in the windows search bar.

I have attempted to use one of the forum members recursive functions to search and seek all bash scripts within a specified directory and search all folders amd sub folders for any files with file extension .sh and store these into an array and then feed each of these files in command line cleansing function.