I enjoy using UNIX/bash commands that support coloured output. Consequently, I have a few aliases defined which automatically enable coloured output of the commands that I know support this option. However, I'm sure there are hundreds of commands out there that support coloured output - I'd like to know what they are.
The ones in my ~...
How can I configure the Zsh tab-completion such that when I type cd ..<TAB> it expands to cd ../ and after pressing <TAB> again proposes the folders in the parent directory for completion?
E.g. it should show the same behavior as when typing for example cd Documents<TAB> which expands to cd Documents/ and after pressing <TAB> again prop...
I'm looking to programmatically modify the edit verb for the shell on Vista. For example, I want right click edit (in explorer) to open a .cs file w/ Notepad++.
How do I change a file association on Windows Vista?
Thanks
...
If I have a file containing some escaped parens, how can I replace all instances with an unescaped paren using Perl?
i.e. turn this:
.... foo\(bar ....
into this
.... foo(bar ....
I tried the following but receivied this error message:
perl -pe "s/\\\(/\(/g" ./file
Unmatched ( in regex; marked by <-- HERE in m/\\( <-- HERE / at ...
I want to execute a command, have the output of that command get gzip'd on the fly, and also echo/tee out the output of that command.
i.e., something like:
echo "hey hey, we're the monkees" | gzip --stdout > my_log.gz
Except when the line executes, I want to see this on standard out:
hey hey, we're the monkees
...
In a bash script, I have to check for the existence of several files.
I know an awkward way to do it, which is as follows, but that would mean that my main program has to be within that ugly nested structure:
if [ -f $FILE1 ]
then
if [ -f $FILE2 ]
then
echo OK
# MAIN PROGRAM HERE
fi
fi
The following version does not work:
([ -f ...
I'm debating whether I should learn PowerShell, or just stick with Cygwin/Perl Scripts/Unix Shell scripts, etc.
The benefit of PowerShell would be that the scripts could be more easily used by teammates that don't have cygwin; however, I don't know if I'd really be writing that many general purpose scripts, or if people would even use t...
According to wikipedia ( http://en.wikipedia.org/wiki/Fork_bomb ), the forkbomb ":(){ :|:& };:" can be stopped with the zsh command "while (sleep 100 &!) do; done", which will supposedly spawn sleep 100 processes until all the forkbomb processes are gone. This seems like magic to me. Can anybody explain why/how this works? I'm especia...
I've had this problem for ages, and it's SO ANNOYING.
Suppose I want to run mysqldump.exe... here's my process: Start->run, type "cmd" ... dir into directory after directory until I finally get to c:/program files/mysql/bin/then I can FINALLY call "mysqldump.exe"
I don't mind using Windows Explorer to get to c:/program files/mysql/bin...
Preferably I'd like to do so with some bash shell scripting, maybe some PHP or PERL and a MySQL db. Thoughts?
...
Hello,
is there an equivalent to OSX open command in cygwin. open opens a file with the default application for that type.
I want to do something like
$ magic-command file.xls
#excel opens as if file.xls would have been double-clicked
$ magic-command file.txt
#notepad opens as if file.xls would have been double-clicked
You get the ...
I am running the following script:
#!/bin/ksh
./clear_old
./rooms_xls.pl 2/23/09
cd doors
./doors_xls.pl 2/23/09
How can I get the date to be today's date based upon the system/server time?
...
I am redirecting the g++ compiler output(both stderr and stdout) to a file on linux. But it is creating an empty file.
I read in some other post that stdout is not flushed after every line. Thats ok, but what about stderr. In my case there are compilation errors running several screens. So, I am interested in stderr output. There is no ...
Hi guys, I'm trying to write a shell using yacc and lex and I'm running into some problems with my I/O redirectors. Currently, I can use the < and > operators fine and in any order, but my problem is I can redirect twice with no error, such as "ls > log > log2"
My rule code is below, can anyone give me some tips on how to fix this? Than...
I am trying to check for files which are larger than a given threshold. I know that the 'du' comand gives me the output for each file/folder, but how to put that in a single line on shell (using awk with if clause?).
...
I've using ClickOnce and I'm struggling with file associations. I can set up the association. Double-clicking an associated file even launches the application.
...However...
I don't know how to get access to the path of the file clicked to launch the App.
Has anyone come across this before?
...
I'm working on configuring the iTerm terminal emulator for the Mac to do what I want. Apparently everything is done through what they call "bookmarks." OK, fine. I'm trying to create a bookmark that will open a tab, cd to a certain Rails project, and run the command script/server. What's supposed to happen is that this will launch the se...
Is there some way to specify a directory (let's say "C:\images") and move every .jpg file from there to another directory (say "D:\media") but preserve the directory structure (so if the file were "C:\images\paintball\july\07\headshot.jpg" after moving it would be "D:\media\paintball\july\07\headshot.jpg")?
I'm using cygwin (but would b...
I have a bunch of tar files in a directory and I want to extract all the files from them at once. But this doesn't seem to do anything:
$ tar xf *.tar
What's going on here? How do I untar a bunch of files at once?
...
Hi all,
I have sed related question:
If I run these command from a scrip:
#my.sh
PWD=bla
sed 's/xxx/'$PWD'/'
...
$ ./my.sh
xxx
bla
Which is fine.
But, if i run:
#my.sh
sed 's/xxx/'$PWD'/'
...
$ ./my.sh
$ sed: -e expression #1, char 8: Unknown option to `s'
I read in tutorials that to substitute env. variables from shell you need...