3,058 reputation
1529
bio website None
location United States
age 53
visits member for 5 years
seen Jul 21 at 6:51
Long-time Informix user and developer, experienced in C and Unix (many variants). Email: jonathan.leffler@gmail.com

Dec
26
comment OS X Terminal command line prompt hostname changed to unknownXXXXXXXXXXXX
Welcome to Stack Overflow. Have you rebooted? Have you restarted terminal? Do you run any Ruby in your profile? How does your computer identify itself? Simply installing RoR should not affect your terminal at all. Your question is in danger of being closed as 'off topic'; it is border-line on topic here in my view. You might get a more receptive response on the Apple Stack Exchange site, but they'll likely want to know answers to the questions I raised.
Dec
19
comment Would shell command join cause out of memory?
It ran out of memory because you're not being very sensible in your request. You're doing a Cartesian product of the rows in file1 and the rows in file2. I'm a little surprised it was unable to hold all of 500 MB in main memory. I don't know if it makes any difference if you reorder file1 and file2 on the command line (worth a try because it is easy), but I won't be surprised to find it makes no difference. Are you on a 32-bit machine or 64-bit? More saliently, is the join executable 32-bit or 64-bit? Are you sure the output is useful?
Dec
19
answered Would shell command join cause out of memory?
Dec
16
comment How to have .profile sourced automatically
Please explain what you mean by 'on system restart', and the context in which the ~/.profile is not being read. Do you mean that it is not read by the shell in your terminal window? Or something else? Have you configured your terminal window to run a login shell?
Dec
16
comment How to have .profile sourced automatically
Which shell are you using? Bourne, Korn and Bash shells normally read ~/.profile.
Dec
16
comment Does rm -r follow symbolic links?
Doesn't really need to be on Super User; it is a question about a program used in shell programming, and as such is on topic for Stack Overflow.
Dec
10
answered UNIX shell command to expand files of any compressed type
Dec
4
comment Using sed get substring between two double quotes
The grep -r does a recursive search through any directories listed in the arguments (*). It's not clear what pattern you have in mind, but grep will pick up the whole line. The purpose of the exercise is to collect information from part of a line. If you're using GNU grep, there are ways to do that (-o); these are non-standard (except to the extent that GNU defines a de facto standard). Similarly with the use of PCRE regular expressions; those are another GNU extension. They're fine if you have GNU grep and no plans to work on platforms where GNU grep is not available by default.
Dec
4
comment Using sed get substring between two double quotes
Do you need to make the .* non-greedy with .*? just in case there's an extra double quote later in the line? Or use [^"]* in place of .*?
Dec
4
comment Using sed get substring between two double quotes
@Jam88: Actually, it will work because of the way anubbhava has written it. The field delimiter is set to double quote. That means that everything up to the first double quote (possibly an empty string) is $1; everything between the first and second double quotes is $2; and everything after the second double quote is in $3 ($4, ...). The file name is (apparently) always between the first two double quotes, so this solution should work (and did when I tested it).
Dec
3
comment Using sed get substring between two double quotes
Welcome to Stack Overflow. As you can see, we occasionally have problems with people having itchy trigger fingers closing perfectly good questions (such as this one) with bad reasons for closure. It doesn't happen all that often (or, I don't get to see the problem in time all that often), but it does happen. Don't forget to read the FAQ before too long.
Dec
3
comment Using sed get substring between two double quotes
To those voting to close — How can this possibly be off-topic? It is about shell programming!! That's PROGRAMMING which is ON TOPIC for Stack Overflow!
Dec
3
answered Using sed get substring between two double quotes
Nov
30
comment vim can not execute unix command with :! due to shell changing
You're right, @DavidW. Since anyone can set their shell in vim (or vi) to whatever they like, it is basically impossible to restrict access to a system if you allow the user access to vi or vim. In times past, people have tried setting the shell to a special program that only executes certain commands. However, if one of those commands is vi or vim, then they have access to the system anyway.
Nov
30
answered vim can not execute unix command with :! due to shell changing
Nov
30
answered What do these chmod parameters mean?
Nov
30
comment What do these chmod parameters mean?
What is your question? And why did you need the -f on /usr/bin/shutdown? If it was because there already was a /usr/bin/shutdown, replacing one with a symlink to the other was probably not a good idea.
Nov
30
comment Installing clearcase 6 and 7 version on windows 7
At the same time, on the same machine? Or independently on different machines? Why would you want to use ClearCase 6, anyway?
Nov
24
comment Setting pipefail for a single piped command
So, your problem is that the script is run by /bin/sh which doesn't recognize set -o pipefail. Consequently, you'll need to ensure that the script is run by /bin/bash instead of /bin/sh. Or, if you're confident, brave — and probably foolhardy — change /bin/sh to be a link to, or copy of, /bin/bash instead of whichever shell it currently is linked to or a copy of. If you're sure that /bin/sh is bash, then you're using behaviour which bash doesn't expose when run as /bin/sh; use bash as bash.
Nov
24
comment Setting pipefail for a single piped command
You'd need to try /bin/sh -c "set -o pipefail"; as it was, the shell was trying to execute a script in the current directory called set and it didn't find it.