Remove any sudo
's in the file and run the script as Administrator.
That being said, the Linux idea of root
and Windows idea of Administrator do not correspond exactly. You may still have permission issues that need to be rectified manually or by modifying the script further, especially on Windows Vista/7.
By the way, the referenced question wanted you to put
>#!/usr/bin/bash
>"$@"
in a file named sudo
, give it executable permission with chmod
, and then put it in some directory in your $PATH
, such as /sbin
. The resulting file will not do anything except execute the paramaters you give it as a command. The idea was to make a "fake" sudo that does nothing. You can also just delete the sudo
's from the file.
Cygwin works by providing a library, cygwin1.dll
, that acts as the translation layer between POSIX and Linux APIs, and the corresponding Windows features. This way it does not need to modify the OS at all. (Cygwin programs, of course, have to be compiled as native Win32 .exe programs, simply linked against different libraries.)
Terminal-based programs can be run both ways: they can be run in the Windows console (where cygwin1.dll automatically translates printed VT100-like sequences into Windows console API functions), or they can be run in VT100-like terminal emulators like MinTTY, URxvt, or PuTTYcyg. (Cygwin usually comes with the former by default.)
Normally services aren't needed for regular operation, unless you install programs that are designed as services (e.g. the OpenSSH server daemon).
[Just for comparison: Interix, aka Services for Unix, works at a lower layer, by providing a "posix" subsystem that runs alongside the regular Win32 subsystem, directly on top of the low-level "Native" or "NT" APIs.
Still, neither the kernel nor other OS components need to be modified nor custom drivers installed, as both methods just add a translation layer in user space.]
Best Answer
I wrote the (rather simple) TOUACExt for SUDO for CygWin, a pre-beta shell script automation that approaches to the behavior of classical
sudo
for Linux:Installation requires copying the four
.sh
scripts to some path directory, creating an alias and just a few more steps detailed in the thread.The results: you type a single
sudo YourCommand
and you get the output of it, without having to worry about the rest of the process.