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 ...


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 ...


18

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


15

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 ...


14

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.


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

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 ...


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 ...


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

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

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

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

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

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 ...


4

You have to set vim in the non compatible mode, so it doesn't behave like vi. You should switch syntax on and switch on filetype detection and plugin detection. Here is a minimal .vimrc you can try: set nocp syntax on filetype plugin indent on This will make vim behave somewhat nicer and give syntax coloring. But there are a lot more things you could ...


4

You need to tell groff which macros you want to use. In this case, you want groff -ge -me -mwww grnexmpl.me > out.ps If you want to see the picture of the circuit diagram, you'll also need grnexample.g present in the directory. I found this by running grog to guess the macros, and then added the www macro, since I could see there was HTML in the ...


4

In zsh (which you can use from Cygwin or Linux), you can use glob qualifiers to pick the largest file. That's the largest file by byte size, not in terms of image dimensions ­— which is probably the right thing here since it privileges high-resolution images. for d in /path/to/music/**/*(/); do rm -f $d/*.jpg(oL[1,-2]N) mv $d/*.jpg $d/cover.jpg done ...


4

To quit less, type q. Also, check out man less for some more, useful bits of information. In general, assuming man has been properly installed, man xyz will tell you how to use the xyz tool. man will normally display through less as well, so to exit from man, again you would type q.


3

Have a look at the CUPS port in cygwin-ports, they provide version 1.4.6 as of January 30th 2011. It patches quite a lot...


3

I know of several indexing tools that support Word documents. Such tools allow you to index documents, then efficiently search words in the index. They don't permit full text searches. Recoll (with Antiword and WvWare). I don't know about Cygwin support. Lucene, with some assembly required. Works on Cygwin, I believe. Sphinx, with any docx-to-text ...


3

Grep treats all lines independently, so it can't do the job on its own. Awk is a general text processing tool. Keep track of what the current package is (in the variable p), and output a match if a requires: line is found in the right package (removing the requires: prefix). <setup.ini awk -vpackage='NAME_OF_PACKAGE' ' sub(/^@ */,"") {p=$0} ...



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