3,058 reputation
1429
bio website None
location United States
age 53
visits member for 4 years, 11 months
seen Jul 2 at 16:19
Long-time Informix user and developer, experienced in C and Unix (many variants). Email: jonathan.leffler@gmail.com

Mar
12
comment grep beginning of file?
You need to quote the file names if they could contain spaces. And you'd probably want to lose the output from 'grep' to /dev/null. You could also use: head -1 "$i" | grep '^<?' || echo "$i" which will only print the file name if it is problematic.
Mar
12
answered Using gcc documentation
Mar
5
comment Unix commandline to repeat command with pipes
You got my up-vote anyway (y'day) for a not desperately well thought out question. What I had in mind was: myscript "ls -lart" "|grep ^d" "|sed 's/^/ /'", which has 3 arguments. It isn't very sensible; but ignoring the extra arguments on the command line isn't all that sensible. It's tricky. If there is more than one argument to 'myscript', you really should do something with or about the extras. But it is debatable whether the 3-argument command line I showed is really better than just erroring: [ $# -gt 1 ] && { echo "Usage: $0 'command | pipeline'" 1>&2; exit 1; }
Mar
3
comment Unix commandline to repeat command with pipes
Why not 'eval "$@"' in the script?
Mar
3
answered Are USB cables device specific?
Feb
26
comment Documenting Unix commands on the command line
@dmckee: When you write 'sh -x', the shell does not do a path-based search for the script - you have to specify the path completely.
Feb
26
comment Documenting Unix commands on the command line
I never had any problems with 'sh -x' on MacOS X 10.5 (or 10.4, ..., or currently on 10.6.2). Which shell are you using? 'sh -x' is common across the majority of shells - I must admit, I was not aware of any that did not support it.
Feb
25
answered Documenting Unix commands on the command line
Feb
22
answered Delete matching files in all subdirectories
Feb
8
answered how to make softlink to bunch of files in one shell comand
Feb
7
answered Does the order of command options in linux matter?
Feb
7
comment Why does \rm work but rm doesn't?
If it asks you whether to examine the files in '/', do you say 'yes' or 'no'? And does the machine continue to work afterwards? Be very careful about deleting everything under root when running as root; the machine keeps going for a surprisingly long time, but there comes a point at which you have to reboot - off a CD or something similar.
Feb
6
answered root directory - www or public_html
Jan
17
comment Multiple Users with owner rights?
Note that there's still only one user with owner rights; that's fixed. But that user can give the group members appropriate access rights. Consider using the SGID bit on the directories to ensure that files created in them belong to the same group (the administrators group).
Jan
16
comment How can I keep a process alive after closing the putty session?
Yup - disown looks to be the way to go for an already running job. It's doable because the shell that started the job can manipulate the properties needed.
Jan
16
comment How can I keep a process alive after closing the putty session?
Too late...at least, for normal operations. It wouldn't be altogether surprising to find that if you attach a debugger to the process, and then tweaked it with an appropriate set of system calls, then perhaps you could put it in the background. But it is not what could be recommended - I wouldn't bother, for example, and I have at least some idea of what might be involved. You have two choices now...either stay connected until it finishes, or stop the current process, and restart a new one using nohup.
Jan
16
comment How can I keep a process alive after closing the putty session?
Normally, control-z puts the process into a state of suspended animation; the bg command puts it into the background. However, that also keeps the process attached to the terminal, whereas nohup detaches it from the terminal and therefore allows putty to disconnect and the process to survive the disconnection.
Jan
14
comment Removing Symantec Antivirus from a Mac?
Right click is equivalent to Control-Click - so I can do that, and was able to remove the System Preference items. I found one of the (other) bits of software that I want to get rid of in /Library/LaunchDaemons; I think I found the Symantec ones in /Library/StartupItems - the other directories looked clean. Thanks for the excellent assistance.
Jan
14
accepted Removing Symantec Antivirus from a Mac?
Jan
14
asked Removing Symantec Antivirus from a Mac?