3,168 reputation
1530
bio website None
location California, USA
age 54
visits member for 5 years, 5 months
seen 2 days ago
Long-time Informix user and developer, experienced in C and Unix (many variants). Email: jonathan.leffler@gmail.com

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.
Nov
24
comment Setting pipefail for a single piped command
It appears that /bin/sh doesn't like set -o pipefail. Is it actually bash in disguise, or is it a different shell? When bash is run as /bin/sh, does it accept set -o pipefail?
Nov
19
comment Prepend new vim buffer with 2 new lines
So, by inference, you could add two blank lines by removing the 'foo' and 'bar'?
Nov
14
comment Shell command to remove a folder contents recursively excluding hidden files?
The rm -fr means that any directories will be forcibly removed along with all their contents, hidden and non-hidden. Using just rm -f would get rid of files and other non-directories. To remove empty directories, you need rmdir. (Using -name "*" is clever, though.)
Nov
14
answered Shell command to remove a folder contents recursively excluding hidden files?
Nov
9
comment find -print0 | xargs -0 grep not working as expected on Ubuntu 10.04
You could also use \( -iname '*.php' ... \) -exec grep -i users +, where the plus means 'build up a command line like xargs without needing to use xargs'. Using a semi-colon \; would mean execute grep for each file as it is found.
Nov
9
comment find -print0 | xargs -0 grep not working as expected on Ubuntu 10.04
Or -iname '*.php' -print0 -o -iname '*.pl' -print0 ......
Oct
21
answered how do I use the grep command to match a particular pattern ? if pattern specified in grep is “4” it should not return lines containing 44
Oct
21
comment how do I use the grep command to match a particular pattern ? if pattern specified in grep is “4” it should not return lines containing 44
What a weird migration!
Oct
17
comment How to do custom sorting using unix sort?
For these three values, you want reverse alphabetic order. For the general case, you'll need to map the names to a sort order number, and then do the sorting using the sort order number. Or go for a scripting language... One possibility is the join command, but you could end up with a lot of sorting — the input files for join must be sorted in one order, and then you'd be using sort again to put the data into a different order (and losing the sort order column as a post-sort step).
Oct
17
awarded  Notable Question