936 reputation
38
bio website
location
age 43
visits member for 2 years
seen yesterday

Aug
15
comment Passing arguments from one command into the next
@StéphaneChazelas: For this specific case, it probably has no advantage. But in a more general case, you might want to modify the list of file names before passing it to the commands. With the pipe form, you can do that by inserting an additional command in the pipeline. For example, if for some reason you want to process the files in sorted order, you can just put a sort -z in the pipeline between find and xargs. Or select a subset using regexps by inserting a grep -z.
Aug
14
answered Passing arguments from one command into the next
Aug
14
awarded  Necromancer
Aug
13
comment XAUTHORITY environ variable set repeatedly on every login
/root is the home directory for the user root, therefore the location is not surprising.
Aug
13
comment Firefox discards URL when server connection times out or fails
I don't see that behaviour (point 1; didn't test point 2) with Firefox (Iceweasel) 24.7 on Debian 7.6 (that's the number in /etc/debian_version; no idea what codename that has). However for gibtsnet.invalid it adds a www. at the front where I didn't have one.
Aug
13
awarded  Nice Answer
Aug
11
comment How does Linux choose which application to open a file?
@richard: The problem is not that it is metadata. The problem is that it is unrelated metadata. The OS uses the execute bit to determine if it tries to run the file, not how it tries to run it. But the latter is the topic of the question. An extended attribute storing a MIME type, or directly the executable to use, would also be meta data, but directly relevant to the question. The execute bit isn't.
Aug
11
comment How does Linux choose which application to open a file?
@richard: But the x bit is a permission bit. It says nothing about the file type, but only about the permission to execute. There can be a perfectly fine executable which you don't have permission to execute (while others may have the permission).
Aug
9
comment Create NTFS partition (in Linux) for dual-boot into Linux/Windows 7
@Mat: Well, technically he's right: His computer is not partitioned. His hard disk almost certainly is, though, even if it contains just one partition. What I guess he really wants is to make space for the NTFS partition (that is, to shrink his Linux partition, probably ext3 or ext4). To which the solution would be to run a partitioning program (like GNU parted) from a live system (so that he can manipulate the partition Linux is installed on). Anyway, the best way to be sure not to lose any Linux files is to make a backup first.
Aug
8
comment what does the dash `-` before `bash` on 'command not found' errors mean?
"The zeroth argument" is not bash terminology, but Unix convention + C indexing: Each program gets passed a parameter list, whose initial entry is the program name, followed by the arguments. Since C arrays are indexed starting with zero, argument zero (that is, the zeroth argument) is the program name, and the actual arguments start with index 1.
Aug
8
comment How does Linux choose which application to open a file?
Since the link to actual code in that linked page doesn't seem to work now, here's another link to the kernel code handling shebang lines: lxr.free-electrons.com/source/fs/binfmt_script.c — of course you could also just install the kernel sources yourself and look into the file.
Aug
8
comment How does Linux choose which application to open a file?
@Kazark: coderwall.com/p/pdg77q
Aug
7
revised How does Linux choose which application to open a file?
Fixed "double marking" of code
Aug
7
comment How does Linux choose which application to open a file?
If you want to use the Gnome associations from the command line, you can use the command gnome-open. I'm sure there are similar command line tools for the other desktop environments. Edit: I just note that John WH Smith gives a command that is independent from your desktop environment.
Aug
7
answered How does Linux choose which application to open a file?
Aug
7
answered Why there are two sequential screen processes?
Aug
7
answered How to use a shell variable inside sed's s command?
Aug
7
comment How to use a shell variable inside sed's s command?
So I get that you did not set destStr with the command above, but got it from somewhere else, and whereever you got it from inserted newline characters in between. That's your real problem (it is completely unrelated to the dollar sign), and that's also why your echo solution works: echo replaces that line feed with a simple space.
Aug
7
comment How to use a shell variable inside sed's s command?
What is the output if you replace sed with echo (but leave the arguments unchanged)?
Aug
7
comment How to use a shell variable inside sed's s command?
Do you get the error with exactly the values you've given? Especially: Does destStr have the literal value string?