1d
comment Bash: Join elements of an array?
I found the answer for my own question above. The answer is that IFS is only recognized for *. In bash man page, search for "Special Parameters" and look for the explanation next to *:
1d
comment Bash: Join elements of an array?
Any idea why this doesn't work if using @ instead of *, as in $(IFS=, ; echo "${foo[@]}") ? I can see that the * already preserves the whitespace in the elements, again not sure how, since @ is usually required for this sake.
Apr
11
comment Vim clipboard access on Mac OS X with term=xterm
Yes, the Vim freezing issue is specific to the iTerms2, since I can't reproduce it in the built-in Terminal. You are right that I can see a bunch of escape sequences sent out when I accidentally press Alt+click on the local shell (non-mouse aware), and I have just treated as a nuisance, since it doesn't cause it to freeze. On the other hand, Vim freezing behavior appears to be a Vim bug. It seems to enter into a non-interruptible state where it waits forever for some keys or key sequence. Making Vim mouse-aware is a good workaround, if I can get the clipboard access to work.
Apr
10
comment Vim clipboard access on Mac OS X with term=xterm
I just started trying to explain the reason I depend on mouse, but it is kind of hard, so let me just say that I do use mouse sometimes for things like scrolling and screen selections using Alt+Drag (bypassing the default behavior). With the default mouse behavior in Vim, any use of Alt+Drag instantly causes Vim to freeze and the only way to get out safely is to send a HUP. If I add the settings that I mentioned, mouse can be used safely, but I lose clipboard access.
Apr
10
revised Vim clipboard access on Mac OS X with term=xterm
added 95 characters in body
Apr
10
comment Vim clipboard access on Mac OS X with term=xterm
I do use iTerm2 (but verified that the problem exists on the built in terminal as well), and I almost never use mouse, once I am with in Vim (trust me, I have been using Vi from the dumb terminals time, before Vim even existed and spoiled everyone with its features :)
Apr
10
asked Vim clipboard access on Mac OS X with term=xterm
Apr
8
awarded Popular Question
Apr
7
comment Getting Linux process resource usage (cpu,disk,network)
With -x or -X option, I am only seeing stats for minflt/s majflt/s %user %system nswap/s CPU, not disk or network stats. E.g., if I also specify -n DEV to see network stats, sar gives separate lines with separate headers. I tested it on RHEL 5.7.
Apr
4
awarded Good Answer
Apr
2
awarded Necromancer
Mar
24
comment Is there a simple method to copy an image from Google Docs to the local clipboard?
Here are a couple of options: techattitude.com/tips-tricks-and-hacks/… Basically, publish the document to get an HTML link and then access the images.
Mar
24
comment Is there a simple method to copy an image from Google Docs to the local clipboard?
Doesn't seem to work anymore, I can see some difference in the way it is selected after a triple click, but I can't get the browser's native context menu.
Feb
28
awarded Notable Question
Feb
24
revised How to trim whitespace from bash variable?
We don't need the "g" flag, since we are anchoring the pattern to the beginning or end of the line.
Feb
24
comment What is the proper indentation for bash scripts?
See my comment on the other answer, you can't indent the end marker of the here document.
Feb
24
comment What is the proper indentation for bash scripts?
This is slightly incorrect, the end marker of the here document still can't be indented. In fact this is my biggest gripe about the here documents, that they only strip leading tabs (I would like 2 spaces as indentation), and that you still can't indent the final marker.
Feb
18
awarded Caucus
Feb
14
awarded Nice Answer
Feb
13
comment Unbuffered read from process using subprocess in Python
Thank you, you saved me some hair pulling.
1 2 3 4 5