I have recently been converted, at least on the principal that I can read and edit my code as I left it from any terminal in the world. But I still ask myself, when will I ever need to do that? I am finding in c++, especially modern c++, my lines are longer, with more namespace qualified references, etc.
So what do people think, 80 colu...
I'm sure I once found a unix command which could print the common lines from two or more files, does anyone know its name? It was much simpler than diff.
...
I could replicate the problem with various shells under FreeBSD, GNU/Linux, and Solaris. It had me head-scratching for more than an hour, so I decided to post the question here.
...
In a UNIX shell script, what can I use to convert decimal numbers into hexadecimal? I thought od would do the trick, but it's not realizing I'm feeding it ASCII representations of numbers.
printf? Gross! Using it for now, but what else is available? :)
...
Our dev team is looking for an IDE like vi or nano or even textpad for windows that has the capability to autocomplete and error correction for bash or shell script for linux. Basically something similar to .NET autocompletion where you will be able to see if an
if[ $# -ne 5 ]; then
has no space between the 5 and the ] will tell yo...
OK,
I want to create a windows shell extention that sits in the file menu much like the "Tortorise SVN" menu.
Does anyone know where I'd begin, a good article, or what interfaces to implement?
Thanks!
...
I am working on a UNIX box, and trying to run an application, which gives some debug logs to the standard output. I have redirected this output to a log file, but now wish to get the lines where the error is being shown.
My problem here is that a simple
cat output.log | grep FAIL
does not help out. As this shows only the lines which ...
Mostly for my amusement, I created a makefile in my $HOME/bin directory called rebuild.mk, and made it executable, and the first lines of the file read:
#!/bin/make -f
#
# Comments on what the makefile is for
...
all: ${SCRIPTS} ${LINKS} ...
...
I can now type:
rebuild.mk
and this causes make to execute.
What are the reasons fo...
I don't know why this method returns a blank string:
- (NSString *)installedGitLocation {
NSString *launchPath = @"/usr/bin/which";
// Set up the task
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:launchPath];
NSArray *args = [NSArray arrayWithObject:@"git"];
[task setArguments:args];
// Set the...
Hello,
We're migrating home folders to a new filesystem, and I am looking for a way to automate it using Perl or a shell script. I don't have much choice in programming languages as the systems are proprietary storage clusters that should remain as unchanged as possible.
Task: Under directory /home/ I have various users' home folders a...
I'm looking for a way to add commands to the green Vista toolbar/commandbar, much like described in this Shell Revealed article. However, the IExplorerCommandProvider interface that they use only seems to be active when used in a Namespace Extension. I need something that will work system-wide, for all folders. Does vista expose anything...
I'm trying to list the files in a directory and do something to them in the Mac OS X prompt.
It should go like this: for f in $(ls -1); do echo $f; done
If I have files without spaces in their names (fileA.txt, fileB.txt), the echo works fine.
If the files include spaces in their names ("file A.txt", "file B.txt"), I get 4 strings (fil...
I would use php in console mode and create an environment to test directly my functions. In fact i would not be force to use a web browser and create a new file each time i want to test a function. I want to get in input the function in the console and then it return the result.
So can someone if it is possible and how do i do?
...
I've got some shell stuff set up that dynamically defines aliases depending on what sort of VC repo the CWD contains -- so, for example, 'd' runs 'svn diff' or 'git diff', depending. (Based on this blog post, if anybody is interested...)
I'd like to define some aliases differently depending on whether I'm in a git repo versus a git-svn ...
I have lots of home directories under /ifshome on Linux. I want to see which users have not logged in for the past 6 months, and my solution is to parse the /ifshome/user/.lastlogin file. Each .lastlogin file has the same format, 1 line:
Last Login: Fri Mar 09 18:06:27 PST 2001
I need to build a shell script that can parse the .lastlo...
This is a idea for a security. Our employees shall have access to some commands on a linux server but not all. They shall e.g. have the possibility to access a log file (less logfile) or start different commands (shutdown.sh / run.sh).
Background information:
All employees access the server with the same user name: Our product runs wit...
The following code gives
[: -ge: unary operator expected
when
i=0
if [ $i -ge 2 ]
then
#some code
fi
why?
...
Hi,
I'm the developer of the trash-cli project.
The trash-cli project is a opensource implementation of the FreeDesktop.org
Trash Specification that provides a command line interface to manage the
trashcan.
Ideally trash-cli provides these commands:
trash (trashes files and directories)
trash-empty (empty the trash...
To find files containing a particular string, I use this often
find . -name * | xargs grep -iH "string"
...
Here's a snippet of code from a shell script I have written:
for src in $(find . -type f -maxdepth 1 \! -name ${deploy} \! -name gvimrc)
do
src=$(basename ${src})
dest="~/.${src}"
copy="${src} -> ${dest}"
cp $src $dest && echo -e "${ok} ${copy}" || echo -e "${fail} ${copy}"
done
For some reason, cp fails to execute. Fo...