Tag Info

Hot answers tagged

23

Does Cygwin work like wine? No. Does it provide a compatibility layer inside a foreign OS? Yes. Wine can run Windows executables on Linux, but Cygwin cannot run Linux executables on Windows. Instead, Linux programs have to be compiled specifically for Cygwin, whereby the aim of the Cygwin project is to make that as straightforward as possible, i.e. it's ...


20

There is watch in cygwin. But it isn't installed by default. You need to install procps package to appear watch. (you can run cygwin installer again and it allows to install only the missed packages without reinstalling the whole cygwin) Instead of watch you can use simple cycle like: while true ; do check file ; sleep 2 ; done


19

MinTTY - here. It makes Cygwin entirely usable on Windows. I would be lost without it. Based on the original PuTTY code, but integrates straight into Cygwin (and in fact, is bundled with Cygwin). Start it with, C:\cygwin\bin\mintty.exe - Or where-ever you installed it. The '-' is key. There are a few other useful additions for Cygwin as well, one ...


16

Cygwin vim ships with vim's default configuration, which leaves vim in vi compatibility mode where it tries to emulate the original vi as closely as possible. Among other limitations, arrow keys do not work in that mode, and backspace just moves the cursor left rather than erasing a character. Creating an empty ~/.vimrc is sufficient to disable vi ...


15

Grepping around in /etc turned up a link that Googling did not. It turns out you can control this in the file /etc/fstab. Just add a line that says none / cygdrive binary 0 0 and the problem should be fixed. No more kludgey fixes in .bashrc, and no messed-up $PATH.


14

$ cygstart theFile.ext This will open theFile.ext with the default app you have set for .ext files.


10

Your error is because you are using double quotes ("), which allow the contents to be interpreted by the shell before it gets to grep. Try grep -r 'c:\\' . instead. echo 'c:\' > test ire@localhost$ cat test c:\ ire@localhost$ grep -r 'c:\\' test c:\ Explanation: \ has a special meaning, both to the shell and to grep. It's used as an escape character, ...


8

You have to use source or eval or to spawn a new shell. When you run a shell script a new child shell is spawned. This child shell will execute the script commands. The father shell environment will remain untouched by anything happens in the child shell. There are a lot of different techniques to manage this situation: Prepare a file sourcefile containg ...


8

Your PATH is bad. It has Windows system directories before Cygwin directories, or maybe doesn't have Cygwin directories at all. This message comes from the Windows command find (that it reports its name as FIND in uppercase is a hint). When you start a Cygwin shell, you usually need to set the PATH. I recommend that you start a login shell (if I recall ...


7

Cygwin : Unix :: Peaches : Trombone (that was on my GRE ;) Given how dramatic Cygwin changes can be, I'd be really wary of having it done without my explicit consent. If you are daring, you could invoke cron to run whatever update script you might choose. If you were looking for the ill-documented setup.exe --quiet-mode for unattended operation, there it ...


7

You could do that by using the source builtin: . script_name Some shells provide an alias named source: source script_name


7

Cygwin is based on Linux, so its utilities come from the same packages as on Linux: column from util-linux join and paste from coreutils


7

You should not use ls to parse files this way. First set extglob globstar by shopt -s extglob globstar then for f in !(*.bat) do printf '%s\n' "$f" done Using find find . -type f ! -name '*.bat' Use the negation operator for a safer treat of files.


5

pkill and pgrep certainly exist within Cygwin, in the procps package (you can search cygwin packages here). It appears to work for me, tony:~$ nohup sleep 100983 & [1] 5476 tony:~$ nohup: ignoring input and appending output to `nohup.out' tony:~$ tony:~$ ps -ef | grep sleep tony 5476 2696 2 23:28:53 /usr/bin/sleep tony:~$ pkill -f sleep ...


5

I am not sure how will you do it with grep, but for such tasks I prefer awk. It gives more control over what I want to do. though I am not expert in awk and still learning but here is how I would have achieved this. PKGNAM="package-name"; awk "/$PKGNAM\$/,/requires:/ { if ( \$0 ~ /requires:/ ) { sub( /^requires:.?/, \"\" ); print } }" UPDATE: updated the ...


5

To see what your terminal is sending when you press a key, switch to insert mode, press Ctrl+V, then the key. Most keys with most terminals send an escape sequence where only the first character is a control character; Ctrl+V inserts the next character literally, so you get to insert the whole escape sequence that way. Different terminals send different ...


5

An attempt to get dpkg working has been abandoned, according to THIS sourceforge page that was setup to investigate getting dpkg to work on Windows Cygwin. Stick to a Virtual Box instance or SSH. EDIT: If you are really interested, there is a huge thread about trying to get it work here.


5

The first two lines strongly suggest that a carriage return (\r) snuck in before the '. Try removing it: tr -d '\r' <~/.bashrc >~/tmp mv ~/tmp ~/.bashrc


5

I believe that what you have experience is not an error but a warning instead. This is just saying that it is your first time installing the application. I have found this helpful thread to assist you further : http://www.techyv.com/questions/error-installation-messege-unix-windows Hope this helps!


5

The minus at the start of $0 means that bash is being started as a login shell. In this case, bash reads initialization commands from .bash_profile, not .bashrc. The simplest fix is to create ~/.bash_profile if it doesn't already exist, and put if [ -f ~/.bashrc ]; then source ~/.bashrc fi at the top. See also: What's the conf file reading ...


5

Yes, of course you have to: rsync -e 'ssh -p 222' ... or: RSYNC_RSH='ssh -p 222' rsync ... Alternatively, you can specify in ~/.ssh/config that ssh connections to that host are to be on port 222 by default: Host that-host Port 222


5

A few things wrong in your code: Using unquoted command substitution ($(...)) without setting $IFS Leaving expansions unquoted is the split+glob operator. The default is to split on space, tab and newline. Here, you only want to split on newline, so you need to set IFS to that as otherwise that means that will not work properly if filenames contain space ...


5

In the unix world, a newline is a line terminator, not a line separator. A text file consists of a series of lines, each of which is terminated by a newline character. This is a linefeed character (character number 10, which can be represented as LF, ^J, \012, \x0a, \n, …). See What's the point in adding a new line to the end of a file? In particular, ...


4

This is a long-standing bug in bash's alias expansion. I could reproduce it on Debian lenny amd64 with bash 3.2.29(1), Debian squeeze i386 with 4.1.5(1), and Windows XP with Cygwin 1.7.7-1 with bash 4.1.9(3). A few experiments show that the bug is very sensitive to variations in how the alias is used. hgfoo or hgfoo : exhibits the bug, but { hgfoo :; } and ...


4

No, it's not possible. vim doesn't support compiled-code plugins, and as you've discovered, vim script plugins can depend on compiled-in features which you may not have.


4

Install Cygwin/X and use xterm. (And then you'll probably either want their version of gvim or the Windows native one.)


4

For completeness, xdg-open on Linux plays much the same role on the Linux side.


4

Put the line syntax on in your ~/.vimrc (assuming you're talking about vim), same as on any other installation of vim.


4

If you run a single command (pwd in your case) through ssh, it is not an interactive shell, so the behavior is correct, in my opinion. You should set your PATH in ~/.profile or ~/.bash_profile, not in ~/.bashrc. As found in bash(1) man page: PARAMETERS (...) Special Parameters The shell treats several parameters specially. ...


4

The problem isn't the semicolon, your second example would take care of that. The problem is that Linux/Unix utilities (and, by extension, Cygwin) don't take that instruction to mean "move all files ending in .XLS;1 to .XLS," as I understand Windows does. You need to move each file individually: for file in *.XLS\;1; do mv "$file" "${file%;1}" done ...



Only top voted, non community-wiki answers of a minimum length are eligible