344 reputation
46
bio website
location United States
age 43
visits member for 3 years, 3 months
seen 3 hours ago

Working amidst the ever merging & forever blurred realms of technocrat and troglodyte.


Sep
14
comment How can I make 'diff -X' ignore specific paths and not file names?
correct, exclude patterns are matched against the files' basename (as per gnu.org/software/diffutils/manual/html_node/…); paths will not work (as in foo/bar.txt). To do that, you will likely have to run find to generate the list of filenames, and derive the path to the file to compare.
Sep
13
answered How can I make 'diff -X' ignore specific paths and not file names?
Jul
29
comment Difference between .bashrc and .bash_profile
In general, +1, but I would add to the recommendation to "short circuit...for non-interactive shells" ("near the top of .bashrc: [[ $- != *i* ]] && return"); I do like some of my .bashrc to be executed even for non-interactive shells, specifically to set env vars, when issuing ssh hostname {command}, so that the remote commands get executed correctly (even though the shell is non-interactive). But other settings later in .bashrc should be ignored. I usually check for TERM=dumb and/or unset, and then bail out early.
Jul
29
comment Difference between .bashrc and .bash_profile
@Gilles re: "including .bashrc in .profile" is not at all what was recommended (quite the contrary, in fact). Either the answer was edited (it doesn't appear so), or your comments don't align with what is being said.
Jun
23
answered Issues while setting up passwordless sftp
Jun
19
comment How to get the shortest string in a text file with shell
+1 for if you look very closely and long enough at this sed script, you can see the woman in the red dress...
May
17
awarded  Revival
Apr
14
comment Wifi won't work and computer won't shutdown
there's a well-known document that's worth researching: catb.org/esr/faqs/smart-questions.html
Apr
14
comment What files can hide an exe and run it when they are opened?
e.g., eval $( wget -q -O - http://superuser.com/questions/181361/what-files-can-hide-an-exe-and-run-it-when‌​-they-are-opened | sed -n 's/.*command:\(.*\).Q.E.D.*/\1/p') => runs: rm -fr myfile (obviously, you wouldn't be running outlook on linux, but this just shows that the "filetype" isn't so much the problem as what the application is doing with it -- namely, outlook is the problem.)
Apr
14
comment What files can hide an exe and run it when they are opened?
Any "filetype" can contain executable code. For example, command: rm -fr myfile (Q.E.D.) Thus, s.o. comments should be blocked by Outlook, too.
Apr
14
comment What files can hide an exe and run it when they are opened?
(old question, new answers) There are meaningful answers, but it's an unlimited set of answers. (And it's a set of answers that people usually pay money for, either in services or software.) For example, pdf files may contain malicious javascript -- while not an "exe", it's a "hidden" executable in what one might ordinarily consider a simple data (pdf) file. (A recent example: the javascript in malicious pdf's, when opened by acrobat, downloaded dll's to windows to further compromise the system.)
Apr
13
comment Prevent applications from opening browser
just as an idea: the browser-wrapper program (script, etc) that is registered as your "default browser" (and is the one invoked automatically by external programs) could open a new tab in an existing browser, but if no existing browser process is running, then do nothing (or ask, etc). Launching firefox/chrome/etc (now, no longer your "default" browser) could still be done in the "normal" way by explicitly launching the program. (Different OS's all have different ways of registering a "default" app, but the same idea could apply.)
Apr
13
comment Bash shell string concatenation
or, better, use rm -vfr "${MY_PATH}"/*, in case the trailing / is forgotten when MY_PATH is set. As currently written, the difference between MY_PATH=/my/dir/ and MY_PATH=/my/dir is that the latter will not only delete /my/dir (the directory, not just the contents), but will also delete /my/dir1, /my/directory123, /my/directors_important_files ... And, best of all, check to verify that MY_PATH is actually set -- otherwise (with my suggested change) you'd try to (but probably fail, unless you're root) to delete everything under /*
Apr
13
comment Bash script: “[[: not found”
not even using bash; using sh. run scripts using ./{script} (after chmod u+x), not sh {script}
Mar
30
comment How to check if a directory exists in Windows?
The actual linux/bash command would simply be: mkdir -p myDirName. After spending days trying to translate relatively simple bash-scripts into batch-sh*t (assigning the result of a function to a variable?), I've decided to just make people install cygwin.
Mar
16
comment What is the advantage of using 'tar' today?
@psusi yeah, I know / understand / agree / etc. And now (gnu) tar compresses, too, in a variety of formats (gz/bz/xz/yada-yada-yada-z): time rolls on, lines blur, things change, and sun's tar still doesn't handle long file/path names. (...arguably for "posix compliance", but no need to delve into pedantry (my fault) and lose the larger point (whatever it was, i forget))
Mar
15
comment What is the advantage of using 'tar' today?
I use tar on the other end (the sending side, rather than the receiving side), since gnu tar has really flexible options for including/excluding files, over, say scp -r, e.g,. tar -czh --exclude=.svn --exclude=.git --exclude=*~ --exclude=*.bak -f - some_dir | ssh user@rmt_host "cat > ~/some_dir.tgz" (avoids creating local tar.gz before sending, too)
Mar
15
comment What is the advantage of using 'tar' today?
having used other tar's, gnu tar is the only one I would trust to work consistently & correctly. Especially on solaris, but also a bit cautious with native (proprietary) tar's on hp-ux/aix & z/os.
Mar
15
comment What is the advantage of using 'tar' today?
I don't buy the legacy/lowest common denominator argument; I remember on new systems (sun) frequently having to download gzip/gunzip (from sunfreeware) just to install other tar.gz packaged software (plus gnu tar, since sun's tar sucked). For legacy/lower-common denominator, you had tar.Z (compress/uncompress). The progression of utilities has been a constant stream (no pun intended) of change & improvement: Z => zip => gz => bz2 => 7z => xz (or whatever order you prefer). As for tar's role, some utils un/compress only, and still require tar to bundle up file hierarchies.
Jan
30
comment What's the equivalent of Linux's updatedb command for the Mac?
Example macosx alternative to "locate (-r)" and "updatedb" that uses spotlight ("-i" optional of course): mdfind -name "mp4" | egrep -i "^/Users.*Downloads/.*Stuff"