[newlib-cygwin] Cygwin: remove CYGWIN=dos_file_warning option
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=13bfb3c63f35d875c1771daea6de4be0176e3b13 commit 13bfb3c63f35d875c1771daea6de4be0176e3b13 Author: Corinna Vinschen Date: Tue Jan 28 21:59:22 2020 +0100 Cygwin: remove CYGWIN=dos_file_warning option This option has been disabled long ago and nobody missed it. Removing drops a bit of unneeded code Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/environ.cc| 1 - winsup/cygwin/external.cc | 5 + winsup/cygwin/fhandler_disk_file.cc | 2 +- winsup/cygwin/globals.cc| 1 - winsup/cygwin/path.cc | 36 winsup/cygwin/path.h| 1 - winsup/cygwin/pinfo.cc | 4 ++-- winsup/cygwin/quotactl.cc | 2 +- winsup/doc/cygwinenv.xml| 11 +-- 9 files changed, 14 insertions(+), 49 deletions(-) diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 7eb4780..3a03657 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -111,7 +111,6 @@ static struct parse_thing } values[2]; } known[] NO_COPY = { - {"dosfilewarning", {_file_warning}, setbool, NULL, {{false}, {true}}}, {"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}}, {"export", {_settings}, setbool, NULL, {{false}, {true}}}, {"glob", {func: glob_init}, isfunc, NULL, {{0}, {s: "normal"}}}, diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 94431bb..14a1dfb 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -452,10 +452,7 @@ cygwin_internal (cygwin_getinfo_types t, ...) res = CYGTLS_PADSIZE; break; case CW_SET_DOS_FILE_WARNING: - { - dos_file_warning = va_arg (arg, int); - res = 0; - } + res = 0; break; case CW_SET_PRIV_KEY: { diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 19a1c5a..be45ad7 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -2062,7 +2062,7 @@ readdir_get_ino (const char *path, bool dot_dot) strcpy (c, ".."); path = fname; } - path_conv pc (path, PC_SYM_NOFOLLOW | PC_POSIX | PC_NOWARN | PC_KEEP_HANDLE); + path_conv pc (path, PC_SYM_NOFOLLOW | PC_POSIX | PC_KEEP_HANDLE); if (pc.isspecial ()) { if (!stat_worker (pc, )) diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc index a9648fe..942bd1c 100644 --- a/winsup/cygwin/globals.cc +++ b/winsup/cygwin/globals.cc @@ -65,7 +65,6 @@ int NO_COPY dynamically_loaded; /* Some CYGWIN environment variable variables. */ bool allow_glob = true; -bool dos_file_warning; bool ignore_case_with_glob; bool pipe_byte; bool reset_com; diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 142a739..4da8884 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -532,31 +532,6 @@ path_conv::get_wide_win32_path (PWCHAR wc) return wc; } -static void -warn_msdos (const char *src) -{ - if (user_shared->warned_msdos || !cygwin_finished_initializing) -return; - tmp_pathbuf tp; - char *posix_path = tp.c_get (); - small_printf ("Cygwin WARNING:\n"); - if (cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_RELATIVE, src, - posix_path, NT_MAX_PATH)) -small_printf ( -" MS-DOS style path detected: %ls\n POSIX equivalent preferred.\n", - src); - else -small_printf ( -" MS-DOS style path detected: %ls\n" -" Preferred POSIX equivalent is: %ls\n", - src, posix_path); - small_printf ( -" CYGWIN environment variable option \"nodosfilewarning\" turns off this\n" -" warning. Consult the user's guide for more details about POSIX paths:\n" -" http://cygwin.com/cygwin-ug-net/using.html#using-pathnames\n;); - user_shared->warned_msdos = true; -} - static DWORD getfileattr (const char *path, bool caseinsensitive) /* path has to be always absolute. */ { @@ -1253,8 +1228,6 @@ path_conv::check (const char *src, unsigned opt, if (tail < path_end && tail > path_copy + 1) *tail = '/'; set_posix (path_copy); - if (is_msdos && dos_file_warning && !(opt & PC_NOWARN)) - warn_msdos (src); } #if 0 @@ -1916,8 +1889,7 @@ symlink_worker (const char *oldpath, path_conv _newpath, bool isdevice) { char *newplnk = tp.c_get (); stpcpy (stpcpy (newplnk, win32_newpath.get_posix ()), ".lnk"); - win32_newpath.check (newplnk, PC_SYM_NOFOLLOW | PC_POSIX - | (isdevice ? PC_NOWARN : 0)); + win32_newpath.check (newplnk, PC_SYM_NOFOLLOW | PC_POSIX);
[newlib-cygwin] Remove CYGWIN=detect_bloda option
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=cb34fffe07e13fc5ccbcc5e9fb7f951eb7d5c2b8 commit cb34fffe07e13fc5ccbcc5e9fb7f951eb7d5c2b8 Author: Corinna Vinschen <cori...@vinschen.de> Date: Tue Dec 15 18:28:03 2015 +0100 Remove CYGWIN=detect_bloda option Diff: --- winsup/cygwin/cygtls.cc | 70 +-- winsup/cygwin/environ.cc | 1 - winsup/cygwin/globals.cc | 1 - winsup/cygwin/net.cc | 12 winsup/doc/cygwinenv.xml | 15 -- winsup/doc/highlights.xml | 5 +--- 6 files changed, 7 insertions(+), 97 deletions(-) diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index 6e9764d..1a2213d 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -27,70 +27,6 @@ _cygtls::call (DWORD (*func) (void *, void *), void *arg) _my_tls.call2 (func, arg, buf); } -static int -dll_cmp (const void *a, const void *b) -{ - return wcscasecmp ((const wchar_t *) a, *(const wchar_t **) b); -} - -/* Keep sorted! - This is a list of well-known core system DLLs which contain code - started in its own thread by the system. Kernel32.dll, for instance, - contains the thread called on every Ctrl-C keypress in a console window. - The DLLs in this list are not recognized as BLODAs. */ -const wchar_t *well_known_dlls[] = -{ - L"advapi32.dll", - L"kernel32.dll", - L"kernelbase.dll", - L"mswsock.dll", - L"ntdll.dll", - L"ole32.dll", - L"shlwapi.dll", - L"wbemprox.dll", - L"ws2_32.dll", -}; - -/* Optional BLODA detection. The idea is that the function address is supposed - to be within Cygwin itself. This is also true for pthreads, since pthreads - are always calling pthread::thread_init_wrapper() in thread.cc. Therefore, - every function call to a function outside of the Cygwin DLL is potentially - a thread injected into the Cygwin process by some BLODA. - - But that's too simple. Assuming the application itself calls CreateThread, - then this is a bad idea, but not really invalid. So we shouldn't print a - BLODA message if the address is within the loaded image of the application. - Also, ntdll.dll starts threads into the application which */ -static void -bloda_detect (DWORD (*func) (void *, void *)) -{ - PIMAGE_DOS_HEADER img_start = (PIMAGE_DOS_HEADER) - GetModuleHandle (NULL); - PIMAGE_NT_HEADERS32 ntheader = (PIMAGE_NT_HEADERS32) - ((PBYTE) img_start + img_start->e_lfanew); - void *img_end = (void *) ((PBYTE) img_start - + ntheader->OptionalHeader.SizeOfImage); - if (((void *) func < (void *) cygwin_hmodule - || (void *) func > (void *) cygheap) - && ((void *) func < (void *) img_start || (void *) func >= img_end)) -{ - MEMORY_BASIC_INFORMATION mbi; - wchar_t modname[PATH_MAX]; - - VirtualQuery ((PVOID) func, , sizeof mbi); - GetModuleFileNameW ((HMODULE) mbi.AllocationBase, modname, - PATH_MAX); - /* Fetch basename and check against list of above system DLLs. */ - const wchar_t *modbasename = wcsrchr (modname, L'\\') + 1; - if (!bsearch (modbasename, well_known_dlls, - sizeof well_known_dlls / sizeof well_known_dlls[0], - sizeof well_known_dlls[0], dll_cmp)) - small_printf ("\n\nPotential BLODA detected! Thread function " - "called outside of Cygwin DLL:\n %W\n\n", - modname); -} -} - void _cygtls::call2 (DWORD (*func) (void *, void *), void *arg, void *buf) { @@ -99,11 +35,7 @@ _cygtls::call2 (DWORD (*func) (void *, void *), void *arg, void *buf) sense to call init_thread or perform BLODA detection. pthread_wrapper eventually calls init_thread by itself. */ if ((void *) func != (void *) pthread_wrapper) -{ - init_thread (buf, func); - if (detect_bloda) - bloda_detect (func); -} +init_thread (buf, func); DWORD res = func (arg, buf); remove (INFINITE); diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 9248e83..51107c5 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -110,7 +110,6 @@ static struct parse_thing } values[2]; } known[] NO_COPY = { - {"detect_bloda", {_bloda}, setbool, NULL, {{false}, {true}}}, {"dosfilewarning", {_file_warning}, setbool, NULL, {{false}, {true}}}, {"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}}, {"export", {_settings}, setbool, NULL, {{false}, {true}}}, diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc index 3430548..5c5d64e 100644 --- a/winsup/cygwin/globals.cc +++ b/winsup/cygwin/globals.cc @@ -65,7 +65,6 @@ int NO_COPY dynamically_loaded; /* Some CYGWIN environment varia
[newlib-cygwin] Remove cygwin/types.h
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8cb99e8ba480c3cda1d6d69af0d8a77540d93934 commit 8cb99e8ba480c3cda1d6d69af0d8a77540d93934 Author: Corinna Vinschen <cori...@vinschen.de> Date: Thu Apr 21 10:12:02 2016 +0200 Remove cygwin/types.h Diff: --- winsup/cygwin/include/cygwin/types.h | 22 -- 1 file changed, 22 deletions(-) diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h deleted file mode 100644 index 1268693..000 --- a/winsup/cygwin/include/cygwin/types.h +++ /dev/null @@ -1,22 +0,0 @@ -/* cygwin/types.h - - Copyright 2001, 2002, 2003, 2005, 2006, 2010, 2011, 2012, 2015 Red Hat Inc. - Written by Robert Collins <rbtcoll...@hotmail.com> - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -#ifndef _CYGWIN_TYPES_H -#define _CYGWIN_TYPES_H - -/* - * This file is provided for backward compatibility. It is no longer used in - * Newlib. Do not add new things to it. - */ - -#include - -#endif /* _CYGWIN_TYPES_H */
Remove cygwin
I have received a computer with some software already installed and I have to clean it up. One of those software is cygwin, I tried to follow the instructions but without success. 1. I can't locate the cygrunsrv: there is no file with this name and there is no command in the bash shell with this name! I have also checked the windows services but I can't find any of the mentioned services: sshd, cron, cygserver, inetd, apache, postgresql, etc 2. I can't delete the cygwin folder because I receive the Permission Denied error, although I have marked all the files as not read only and changed the ownership to my account. Can somebody help me out? Thanks -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Remove cygwin
18.10.2011 15:11, Casual Trash пишет: I have received a computer with some software already installed and I have to clean it up. One of those software is cygwin, I tried to follow the instructions but without success. 1. I can't locate the cygrunsrv: there is no file with this name and there is no command in the bash shell with this name! I have also checked the windows services but I can't find any of the mentioned services: sshd, cron, cygserver, inetd, apache, postgresql, etc To remove services that installed by cygrunsrv install it again: cmd# setup.exe -p cygrunsrv locate it and run shell prompt: cmd# cygrunsrv -L # to list installed services ... cmd# cygrunsrv -R sshd # to individually remove each installed service Next you can remove whole cygwin installation directory... That is. 2. I can't delete the cygwin folder because I receive the Permission Denied error, although I have marked all the files as not read only and changed the ownership to my account. Can somebody help me out? This can happen because some process have open handles to this directory. Try run procexp.exe Ctrl+F and type path to find and kill such processes... -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Remove cygwin
On 10/18/2011 9:03 AM, Oleksandr Gavenko wrote: 18.10.2011 15:11, Casual Trash пишет: I have received a computer with some software already installed and I have to clean it up. One of those software is cygwin, I tried to follow the instructions but without success. 1. I can't locate the cygrunsrv: there is no file with this name and there is no command in the bash shell with this name! I have also checked the windows services but I can't find any of the mentioned services: sshd, cron, cygserver, inetd, apache, postgresql, etc To remove services that installed by cygrunsrv install it again: cmd# setup.exe -p cygrunsrv locate it and run shell prompt: cmd# cygrunsrv -L # to list installed services ... cmd# cygrunsrv -R sshd # to individually remove each installed service Next you can remove whole cygwin installation directory... That is. 2. I can't delete the cygwin folder because I receive the Permission Denied error, although I have marked all the files as not read only and changed the ownership to my account. Can somebody help me out? This can happen because some process have open handles to this directory. Try run procexp.exe Ctrl+F and type path to find and kill such processes... I would add: cygwin is not a monolithic thing. I have a number of cygwin packages installed, but do not run any servers. So an installation does not necessarily have any servers for you to worry about. On the other hand, the permission-denied issue suggests that there *may* be a running server with files open (e.g., dll's), and that can prevent deletion. procexp is a tool that you can find and install from the web. It's pretty useful, so you may as well leave it installed. Regards -- Eliot Moss -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Remove cygwin
Thanks to everybody for the replies. I have tried to install again the cygrunsrv, setup.exe doesn't return any error but I can't find the cygrunsrv anywhere. And procexp.exe has found any process in the cygwin folder. So I can suppose that there is no service running and no process is blocking the cygwin folder, but why I can't delete it? Somebody has an idea? Thanks On 10/18/2011 9:03 AM, Oleksandr Gavenko wrote: 18.10.2011 15:11, Casual Trash ÐÐÑÐÑ: I have received a computer with some software already installed and I have to clean it up. One of those software is cygwin, I tried to follow the instructions but without success. 1. I can't locate the cygrunsrv: there is no file with this name and there is no command in the bash shell with this name! I have also checked the windows services but I can't find any of the mentioned services: sshd, cron, cygserver, inetd, apache, postgresql, etc To remove services that installed by cygrunsrv install it again: cmd# setup.exe -p cygrunsrv locate it and run shell prompt: cmd# cygrunsrv -L # to list installed services ... cmd# cygrunsrv -R sshd # to individually remove each installed service Next you can remove whole cygwin installation directory... That is. 2. I can't delete the cygwin folder because I receive the Permission Denied error, although I have marked all the files as not read only and changed the ownership to my account. Can somebody help me out? This can happen because some process have open handles to this directory. Try run procexp.exe Ctrl+F and type path to find and kill such processes... I would add: cygwin is not a monolithic thing. I have a number of cygwin packages installed, but do not run any servers. So an installation does not necessarily have any servers for you to worry about. On the other hand, the permission-denied issue suggests that there *may* be a running server with files open (e.g., dll's), and that can prevent deletion. procexp is a tool that you can find and install from the web. It's pretty useful, so you may as well leave it installed. Regards -- Eliot Moss -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
RE: Remove cygwin
Casual Trash sent the following at Tuesday, October 18, 2011 11:42 AM Thanks to everybody for the replies. I have tried to install again the cygrunsrv, setup.exe doesn't return any error but I can't find the cygrunsrv anywhere. And procexp.exe has found any process in the cygwin folder. So I can suppose that there is no service running and no process is blocking the cygwin folder, but why I can't delete it? Somebody has an idea? How are you trying to delete C:\cygwin? Windows won't let one remove a folder if it is the current working directory of any process. An easy mistake in Windows Explorer is to have C:\cygwin as the working directory when trying to delete it from the left panel directory tree. I'd try using Windows Explorer, going to C:\, and deleting from there. Another approach would be re-booting (a) into safe mode or (b)at least keeping things from automatically loading. (I forget exactly how to do the latter so I just hold down shift, alt, and control when booting - one of them works.) If the person is available, you might ask whoever gave you the computer (and presumably installed cygwin) for help or advice. Please excuse me if you've already tried any of the above. The email string suggests that you might have tried some, but it is not clear to me. Good luck, - Barry Disclaimer: Statements made herein are not made on behalf of NIAID. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Remove cygwin
On 2011-10-18 14:11, Casual Trash wrote: I have received a computer with some software already installed and I have to clean it up. One of those software is cygwin, I tried to follow the instructions but without success. 1. I can't locate the cygrunsrv: there is no file with this name and there is no command in the bash shell with this name! I have also checked the windows services but I can't find any of the mentioned services: sshd, cron, cygserver, inetd, apache, postgresql, etc 2. I can't delete the cygwin folder because I receive the Permission Denied error, although I have marked all the files as not read only and changed the ownership to my account. Can somebody help me out? Thanks I'm not sure it applies in your case, but sometimes (and this happened to me under Windows 7), when you have folders or files, or maybe a whole disk, that are from an older installation so to speak, it can be hard to remove such files. I had that happen to me when I took a disk from an another computer that wasn't formatted and had cygwin on it among other things. I could not delete the cygwin folder even though I was running as admin. I solved it by running two commands (and here the old cygwin folder I wanted to delete was located on e:\cygwin): First, take ownership of all files (recursively): $ takeown /F E:\cygwin /R Then, change permissions recursively: $ icacls E:\cygwin /grant Administrators:F /t after that I could remove those files and folders from that secondary disk. Maybe it doesn't apply for you, I'm not sure about that, and use with care, but I hope it helps. - EL -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
entirely remove cygwin
Hi there, could somebody send me details or a web link to fully uninstall cygwin so I can start over from scratch? Just removing the C:/CYGWIN directory is not enough. everytime I reinstall parts of the OS remain in place. I want to fully start over. Cheers, Noah -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: entirely remove cygwin
Noah writes: could somebody send me details or a web link to fully uninstall cygwin so I can start over from scratch? http://cygwin.com/faq/faq-nochunks.html#faq.setup.uninstall-all ..mark -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin Path for Called Batch Script
Kurt Franke wrote: Scott Wegner swegner at hdfgroup.org writes: Greg Chicares wrote: On 2008-03-25 13:30Z, Scott Wegner wrote: I am trying to create a wrapper Cygwin bash script to add functionality to an existing Windows batch script. In my Cygwin script, I would like to call the batch file with something like: ... cmd.exe /k batch-script.bat params ... Calling the script in this fashion seems to generally work (in that the script executes). However, I have trouble because the Cygwin path is prepended to the Windows path in the batch script. As a result, trying to use the Windows find use Cygwin's instead. If you write %SystemRoot%\system32\find in the batch file, then you'll get the msw find whether or not any Cygwin directory is on your path. Hi Greg, Thanks for the quick reply. This is a feasible solution. However, I'd rather find a solution where the batch script can remain unaware of its Cygwin context. Once I get things working, I plan on creating bash script wrappers for many Windows batch scripts, so I'd like to make the changes in the Cygwin environment, rather than editing each batch script individually. I'll keep looking at let you know if I find anything. Scott Hi Scott, you may just remove all path components from PATH which are part of cygwin. I use the following bash function to do those removing since long years ago: rmpc() { local C=$2 local R= local OIFS=$IFS IFS=$IFS: set -- $1 IFS=$OIFS for i in $@ do if [ x$i != x$C ] then if [ x$R != x ] then R=$R:$i else R=$i fi fi done echo $R } to work correctly make sure your wrapper script starts with bash in magic line - #! /bin/bash for example but not #! /bin/sh because when invoked as bourne shell necessary functionality may be missed you may add this function directly after the magic line for invocation then just before calling your dos batch scripts remove the unwanted path components from PATH you shouldn't do this earlier in your code because no cygwin applications and scripts are found after this unless they are hashed by bash in a pervious call PATH=`rmpc $PATH /bin` PATH=`rmpc $PATH /usr/bin` you may remove any path component this way PATH=`rmpc $PATH .` # remove . PATH=`rmpc $PATH `# remove blank path components caution: this mechanism remove all multiple occurences of a componente from PATH when returned from your dos batch script you are lacking the most cygwin functionality. to get it again you have to save the PATH previous to the changes: SAVE_PATH=$PATH and just restore it after the dos script returned: PATH=$SAVE_PATH Hi Kurt, Thanks for the reply (as well as others who have contributed). This looks like it will fit my needs perfectly. I'll give it a try and post back if I have any more trouble. Thanks! Scott regards kf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin Path for Called Batch Script
Scott Wegner swegner at hdfgroup.org writes: Greg Chicares wrote: On 2008-03-25 13:30Z, Scott Wegner wrote: I am trying to create a wrapper Cygwin bash script to add functionality to an existing Windows batch script. In my Cygwin script, I would like to call the batch file with something like: ... cmd.exe /k batch-script.bat params ... Calling the script in this fashion seems to generally work (in that the script executes). However, I have trouble because the Cygwin path is prepended to the Windows path in the batch script. As a result, trying to use the Windows find use Cygwin's instead. If you write %SystemRoot%\system32\find in the batch file, then you'll get the msw find whether or not any Cygwin directory is on your path. Hi Greg, Thanks for the quick reply. This is a feasible solution. However, I'd rather find a solution where the batch script can remain unaware of its Cygwin context. Once I get things working, I plan on creating bash script wrappers for many Windows batch scripts, so I'd like to make the changes in the Cygwin environment, rather than editing each batch script individually. I'll keep looking at let you know if I find anything. Scott Hi Scott, you may just remove all path components from PATH which are part of cygwin. I use the following bash function to do those removing since long years ago: rmpc() { local C=$2 local R= local OIFS=$IFS IFS=$IFS: set -- $1 IFS=$OIFS for i in $@ do if [ x$i != x$C ] then if [ x$R != x ] then R=$R:$i else R=$i fi fi done echo $R } to work correctly make sure your wrapper script starts with bash in magic line - #! /bin/bash for example but not #! /bin/sh because when invoked as bourne shell necessary functionality may be missed you may add this function directly after the magic line for invocation then just before calling your dos batch scripts remove the unwanted path components from PATH you shouldn't do this earlier in your code because no cygwin applications and scripts are found after this unless they are hashed by bash in a pervious call PATH=`rmpc $PATH /bin` PATH=`rmpc $PATH /usr/bin` you may remove any path component this way PATH=`rmpc $PATH .` # remove . PATH=`rmpc $PATH `# remove blank path components caution: this mechanism remove all multiple occurences of a componente from PATH when returned from your dos batch script you are lacking the most cygwin functionality. to get it again you have to save the PATH previous to the changes: SAVE_PATH=$PATH and just restore it after the dos script returned: PATH=$SAVE_PATH regards kf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Remove Cygwin Path for Called Batch Script
Hello, I am trying to create a wrapper Cygwin bash script to add functionality to an existing Windows batch script. In my Cygwin script, I would like to call the batch file with something like: ... cmd.exe /k batch-script.bat params ... Calling the script in this fashion seems to generally work (in that the script executes). However, I have trouble because the Cygwin path is prepended to the Windows path in the batch script. As a result, trying to use the Windows find use Cygwin's instead. My question is, whether there is a way to easily strip the Cygwin entries from the path for the batch call. Hopefully the solution would be portable, and not affect the environment outside of the bash script. Thanks, Scott Wegner -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin Path for Called Batch Script
On 2008-03-25 13:30Z, Scott Wegner wrote: I am trying to create a wrapper Cygwin bash script to add functionality to an existing Windows batch script. In my Cygwin script, I would like to call the batch file with something like: ... cmd.exe /k batch-script.bat params ... Calling the script in this fashion seems to generally work (in that the script executes). However, I have trouble because the Cygwin path is prepended to the Windows path in the batch script. As a result, trying to use the Windows find use Cygwin's instead. If you write %SystemRoot%\system32\find in the batch file, then you'll get the msw find whether or not any Cygwin directory is on your path. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin Path for Called Batch Script
Greg Chicares wrote: On 2008-03-25 13:30Z, Scott Wegner wrote: I am trying to create a wrapper Cygwin bash script to add functionality to an existing Windows batch script. In my Cygwin script, I would like to call the batch file with something like: ... cmd.exe /k batch-script.bat params ... Calling the script in this fashion seems to generally work (in that the script executes). However, I have trouble because the Cygwin path is prepended to the Windows path in the batch script. As a result, trying to use the Windows find use Cygwin's instead. If you write %SystemRoot%\system32\find in the batch file, then you'll get the msw find whether or not any Cygwin directory is on your path. Hi Greg, Thanks for the quick reply. This is a feasible solution. However, I'd rather find a solution where the batch script can remain unaware of its Cygwin context. Once I get things working, I plan on creating bash script wrappers for many Windows batch scripts, so I'd like to make the changes in the Cygwin environment, rather than editing each batch script individually. I'll keep looking at let you know if I find anything. Scott -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin Path for Called Batch Script
Scott Wegner [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ... However, I'd rather find a solution where the batch script can remain unaware of its Cygwin context. Once I get things working, I plan on creating bash script wrappers for many Windows batch scripts, so I'd like to make the changes in the Cygwin environment, rather than editing each batch script individually. What I do is have a batch file I call before executing any dos commands (sort of a .dosrc), and in that I set my dos path. So for example I have a bash function dos that looks like this: function dos() { local s=/c; if [ $1 == ]; then s=/k; fi; cmd $s %ETC%\login $*; } ... where %ETC%\login.bat is my .dosrc file. This enables me to say to bash, dos and get a dos prompt, or dos foo and execute foo in a dos context. LIkewise for things such as shortcuts to cmd.exe, I use cmd.exe /k %ETC%\login. I know this is not exactly what you're looking to do but perhaps something similar might work in your case. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin Path for Called Batch Script
Scott Wegner wrote: My question is, whether there is a way to easily strip the Cygwin entries from the path for the batch call. Hopefully the solution would be portable, and not affect the environment outside of the bash script. PATH is just a regular variable like any other. If you want to remove something from it, use whatever text processing tool you like. The shell lets you set environment variables only for the command being executed using the syntax var=value command arg ..., so: PATH=$(perl -e 'print join(:, grep([EMAIL PROTECTED]/(usr/)?bin@, split(:, $ENV{PATH})))') cmd.exe /k batch-script.bat params Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin Path for Called Batch Script
Hello $ cygpath --help Is this infomation useful for you? Rerads Tatsuro --- Scott Wegner [EMAIL PROTECTED] wrote: Greg Chicares wrote: On 2008-03-25 13:30Z, Scott Wegner wrote: I am trying to create a wrapper Cygwin bash script to add functionality to an existing Windows batch script. In my Cygwin script, I would like to call the batch file with something like: ... cmd.exe /k batch-script.bat params ... Calling the script in this fashion seems to generally work (in that the script executes). However, I have trouble because the Cygwin path is prepended to the Windows path in the batch script. As a result, trying to use the Windows find use Cygwin's instead. If you write %SystemRoot%\system32\find in the batch file, then you'll get the msw find whether or not any Cygwin directory is on your path. Hi Greg, Thanks for the quick reply. This is a feasible solution. However, I'd rather find a solution where the batch script can remain unaware of its Cygwin context. Once I get things working, I plan on creating bash script wrappers for many Windows batch scripts, so I'd like to make the changes in the Cygwin environment, rather than editing each batch script individually. I'll keep looking at let you know if I find anything. Scott -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar http://pr.mail.yahoo.co.jp/toolbar/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: Remove cygwin services
On Fri, 12 Aug 2005, Herb Martin wrote: It might help (pure speculation) to enable one of the signals when creating Cygwin-Apps as services. This way the stop will include a HUP or TERM. $ cygrunsrv --help 21 | grep -C2 'HUP' -s, --termsig signalOptional signal to send to service application when service is stopped. signal can be a number or a signal name such as HUP, INT, QUIT, etc. Default is TERM. -y, --dep svc_name2 Optional name of service that must be started As you can see, cygrunsrv sends SIGTERM to processes by default when the service is stopped. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_[EMAIL PROTECTED] |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! If there's any real truth it's that the entire multidimensional infinity of the Universe is almost certainly being run by a bunch of maniacs. /DA -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Remove cygwin services
What do I do in order to remove installed services of cygwin like sshd, init and so on? Thanks. Jason -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: Remove cygwin services
[mailto:[EMAIL PROTECTED] On Behalf Of Jason FU What do I do in order to remove installed services of cygwin like sshd, init and so on? [ I am new to cygwin so factor this into my answer...] cygrunsrv -R SERVICE_NAME Example: cygrunsrv -R sshd You may also use the Windows services.msc Control Panel to disable or set a service to manual. Note that manual service MAY still run if some other service starts them -- manual doesn't mean a user/admin must start them, only that the OS will not start them automatically unless requested to do so by another process or by an actual manual user/admin request. I have been unable to use cygrunsrv to modify a service; so far, I have always removed the service and re-added it. -- Herb Martin -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove cygwin services
Herb Martin HerbM at learnquick.com writes: [mailto:cygwin-owner at cygwin.com] On Behalf Of Jason FU What do I do in order to remove installed services of cygwin like sshd, init and so on? [ I am new to cygwin so factor this into my answer...] cygrunsrv -R SERVICE_NAME Example: cygrunsrv -R sshd You may also use the Windows services.msc Control Panel to disable or set a service to manual. Note that manual service MAY still run if some other service starts them -- manual doesn't mean a user/admin must start them, only that the OS will not start them automatically unless requested to do so by another process or by an actual manual user/admin request. I have been unable to use cygrunsrv to modify a service; so far, I have always removed the service and re-added it. -- Herb Martin [EMAIL PROTECTED] ~ $ cygrunsrv.exe -R sshd cygrunsrv: Error removing a service: QueryServiceStatus: Win32 error 1053: The service did not respond to the start or control request in a timely fashion. [EMAIL PROTECTED] ~ $ cygrunsrv.exe -R init cygrunsrv: Error removing a service: QueryServiceStatus: Win32 error 1053: The service did not respond to the start or control request in a timely fashion. By root, I mean this is an administrator a/c. Jason -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: Remove cygwin services
[EMAIL PROTECTED] ~ $ cygrunsrv.exe -R init cygrunsrv: Error removing a service: QueryServiceStatus: Win32 error 1053: The service did not respond to the start or control request in a timely fashion. By root, I mean this is an administrator a/c. As I understand cygrunsrv, when you remove a service it also assumes you wish to stop that service. If the service refuses to stop -- which isn't that uncommon for services started under cygrunsrv (for testing) since they don't know they are services -- then you will see that error. I believe that cygrunsrv has already changed the registry (unconfirmed) and therefore the service will be gone on next boot. (If not, I would consider this a bug in cygrunsrv.) It might help (pure speculation) to enable one of the signals when creating Cygwin-Apps as services. This way the stop will include a HUP or TERM. -- Herb Martin -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin entirely from Windows 2000 Server SP3
Corinna == Corinna Vinschen [EMAIL PROTECTED] writes: Corinna There shouldn't be any cyg* files in the system folder. Corinna If you want to have it entirely clean, you'd have to Corinna delete all registry keys */Software/Cygnus Corinna Solutions/Cygwin with * being HKLM as well as all HKU Corinna subkeys of users which have used Cygwin. I've never had a problem with this, but: oughtn't he ensure that all Cygwin services are stopped before he deletes c:\cygwin? If not, I fear he'll get access denied errors when trying to delete the relevant .exe and .dlls. -- Tobacco: It's not just for killing children anymore. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin entirely from Windows 2000 Server SP3
On Mar 22 08:39, Eric Hanchrow wrote: Corinna == Corinna Vinschen [EMAIL PROTECTED] writes: Corinna There shouldn't be any cyg* files in the system folder. Corinna If you want to have it entirely clean, you'd have to Corinna delete all registry keys */Software/Cygnus Corinna Solutions/Cygwin with * being HKLM as well as all HKU Corinna subkeys of users which have used Cygwin. I've never had a problem with this, but: oughtn't he ensure that all Cygwin services are stopped before he deletes c:\cygwin? If not, I fear he'll get access denied errors when trying to delete the relevant .exe and .dlls. Well, yes, but I thought I let this as an exercise for the reader... Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developermailto:[EMAIL PROTECTED] Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Remove Cygwin entirely from Windows 2000 Server SP3
You have told me all I needed to know Corinna. Thanks. George Hester __ Corinna Vinschen wrote in message news:[EMAIL PROTECTED] On Mar 22 08:39, Eric Hanchrow wrote: Corinna == Corinna Vinschen [EMAIL PROTECTED] writes: Corinna There shouldn't be any cyg* files in the system folder. Corinna If you want to have it entirely clean, you'd have to Corinna delete all registry keys */Software/Cygnus Corinna Solutions/Cygwin with * being HKLM as well as all HKU Corinna subkeys of users which have used Cygwin. I've never had a problem with this, but: oughtn't he ensure that all Cygwin services are stopped before he deletes c:\cygwin? If not, I fear he'll get access denied errors when trying to delete the relevant .exe and .dlls. Well, yes, but I thought I let this as an exercise for the reader... Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developermailto:[EMAIL PROTECTED] Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Remove Cygwin entirely from Windows 2000 Server SP3
Is all I have to do to remove Cygwin from Windows 2000 Server SP3 is remove any and all cyg*.* files from C:\WINNT\sytem32 and delete the C:\cygwin folder? George Hester __ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
how to remove cygwin
On Saturday 5 Jan 02, Jerry uu writes: thank you This is in the FAQ. Regards, David (Cygwin FAQ maintainer) -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/