Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to automate cygwin and mintty

I currently have this under my shortcut

C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -

after that is run i have to type in

cd x:ENTER

then i run a curl script which does not change.

I tried to automate it by running the following command but it does not seem to work

my SH file

#!/bin/bash

cd x:
curl http://thedomain.com/update.json --connect-timeout 10000 --max-time 10000 --data-binary @jsonfilename -H 'Content-type:application/json;charset=utf-8;[email protected];'

this is what i run in CMD

mintty.exe --exec 'c:/cygwin/bin/test.sh'

cygwin popup for 2 seconds and disappear.

please help

update

New error

$ /bin/test.sh
      0 [main] bash 12000 child_info_fork::abort: cygreadline7.dll: Loaded to different address: parent(0x3B0000) != child(0x320000)
/bin/test.sh: fork: retry: Resource temporarily unavailable
      0 [main] bash 12052 child_info_fork::abort: cygreadline7.dll: Loaded to different address: parent(0x3B0000) != child(0x2B0000)
/bin/test.sh: fork: retry: Resource temporarily unavailable
      0 [main] bash 9304 child_info_fork::abort: cygreadline7.dll: Loaded to different address: parent(0x3B0000) != child(0x3A0000)
/bin/test.sh: fork: retry: Resource temporarily unavailable
      0 [main] bash 9036 child_info_fork::abort: cygreadline7.dll: Loaded to different address: parent(0x3B0000) != child(0x3A0000)
/bin/test.sh: fork: retry: Resource temporarily unavailable
      0 [main] bash 9588 child_info_fork::abort: cygreadline7.dll: Loaded to different address: parent(0x3B0000) != child(0x3C0000)
/bin/test.sh: fork: Resource temporarily unavailable
like image 760
nkman Avatar asked Apr 10 '13 18:04

nkman


People also ask

How do I use Cygwin mintty?

Mintty Saves the DayAt the Select Packages screen, look under “Shells” and find Mintty. Click where it says “Skip” and hit the Next button. Once you've finished installing it, you should be able to go to Start > All Programs > Cygwin > mintty to launch it.

What is Minttyrc?

DESCRIPTION. Mintty is a terminal emulator for Cygwin with a native Windows user interface and minimalist design.

Does git install mintty?

For MSYS2, mintty is installed by default, or it can be installed later with the command pacman -S mintty . In Git-for-Windows, mintty is installed by default and invoked as "Git Bash".

Where can I find mintty EXE?

In Cygwin, it is installed as the default terminal by Cygwin's setup.exe. In MSYS, the mintty package can be installed with the command mingw-get install mintty . Alternatively, binaries for Cygwin 1.7, 1.5 and MSYS can be found on the downloads page.


2 Answers

for whoever is interested in this .. here is the solution

create a shortcut in windows for Mintty with the following taret

Assuming your shell file is located in c:\cygwin\bin

C:\cygwin\bin\mintty.exe /bin/bash -l -e '/cygdrive/c/cygwin/bin/test.sh'

once you have the shortcut working, you can do a windows task scheduler and take it from there.

Windows 7 Pro: Create a basic task with Windows Task Scheduler to start DAILY and go through all the steps. Once you have created the task, go to Properties and then go to TRIGGERS tab and click EDIT

under ADVANCED SETTINGS frame, you'll se REPEAT TASK EVERY.... self-explanatory from there.

like image 87
nkman Avatar answered Sep 18 '22 01:09

nkman


Your command is telling mintty to start up and run your script, which is what it proceeds to do, then exit. That "popup" as you call it, is the terminal opening, running the command you passed it, and then exiting since it has done its job.

like image 44
Costa Avatar answered Sep 18 '22 01:09

Costa