| bio | website | |
|---|---|---|
| location | United States | |
| age | ||
| visits | member for | 1 year, 10 months |
| seen | Jun 11 at 19:17 | |
| stats | profile views | 488 |
Debian user, GNU/Linux enthusiast, FLOSS supporter, hobby developer.
|
Dec 20 |
comment |
Is there any way to test out PS1 Bash Prompts before committing them? A web tool sounds like even more of a pain than starting a new shell, unless you want to play around with bash when not on a Unix machine. Is that your goal (a web-based bash)? |
|
Dec 20 |
comment |
Is there any way to test out PS1 Bash Prompts before committing them? Define "commit". The easiest way for me is to just start a new shell. Then if I screw it up I can just exit it and no permanent changes have been made. |
|
Dec 20 |
comment |
how to add a description in footer As @ChrisDown has said, just go with a version control system. No need to reinvent existing, sophisticated wheels crudely (it takes a lot of time to implement an efficient and robust VCS). |
|
Dec 20 |
comment |
how to add a description in footer You need to be more specific about what exactly you are trying to do. If you just want revision control there are many existing tools that already exist for that, although some initial learning curve overhead might be required. |
|
Dec 20 |
comment |
echo vs <<<, or Useless Use of echo in Bash Award? @Random832 Indeed, the site doesn't allow comments to be edited after 5 minutes and I was too lazy to delete my original comment and repost. The target of the "To clarify" bit in my 2nd comment was my first comment. |
|
Dec 20 |
comment |
echo vs <<<, or Useless Use of echo in Bash Award? @Random832 Replacing cat with grep doesn't change anything about what I said above. Please reread my last comment, which doesn't actually mention cat at all. The OP thinks he is comparing heredocs vs redirection, when he is actually comparing heredocs and pipes. |
|
Dec 20 |
comment |
echo vs <<<, or Useless Use of echo in Bash Award? To clarify, you aren't actually measuring herestring / heredoc vs redirection, since the same redirection is present in all 3 examples ( > /dev/null). You are measuring single-process herestring / heredoc vs a 2-process pipe, and all that this exercise has demonstrated is that the pipe is slower, which is not a surprising result. |
|
Dec 20 |
comment |
echo vs <<<, or Useless Use of echo in Bash Award? What is the purpose of echo | cat besides UUOC? |
|
Dec 19 |
comment |
What fast UI mechanisms for page scrolling exist for desktop Linux users? I actually switched to a scroll-wheel-less trackball mouse a while ago so all of this is recollection. I'd probably call it "middle mouse scrolling". If I remember correctly, paste only triggered on a simple click, scrolling happened if you held the button down and moved the mouse around. I might have had some settings in my xorg.conf that helped (I tend to copy over my old xorg.conf customizations to new installs so I don't remember exactly). If you are using GNOME try poking around in your mouse preferences and see if there's anything there. |
|
Dec 19 |
comment |
What fast UI mechanisms for page scrolling exist for desktop Linux users? You call "holding down middle mouse and moving the mouse" "Windows-style" scrolling but I was never aware that there was anything Windows-specific about it. I actually had no idea what you meant by "Windows-style" before I read through your question carefully. You may want to edit your question to use a more enlightening term as I doubt many other people on this site will know what you mean. As far as I can remember that was fairly standard behavior even on Linux - it's probably just a matter of mouse configuration and whether holding down the mouse wheel registers as middle mouse button. |
|
Dec 19 |
comment |
.bashrc overwritten but still sourced — how can it be recovered? You can save your current settings but if your .bashrc had any logic in it that depended on local variables like host, user, etc. that is probably unrecoverable. The real answer is to restore from your most recent backup. You do have a recent backup right? |
|
Dec 18 |
comment |
Remove large chunks from json using vim @DeerHunter Don't chisels usually require hammers to provide force? :P |
|
Dec 18 |
comment |
Remove large chunks from json using vim @ChrisJohnsen Yes that would work. The reason I didn't use it is because it has the risk of deleting an extra line when there is a bare {} block, if such a block existed (probably not). |
|
Dec 17 |
comment |
Remove large chunks from json using vim This is a clever and novel approach. You should mention that it requires the line offset of the pattern line to be consistent within its "block" though. |
|
Dec 14 |
comment |
globbing, sed, or awk html files Just a warning: it is not possible to parse XML-type languages reliably with regular expressions as XML is not a regular language. The best you can do is an ad-hoc approximation for a restricted subset of valid (X)HTML. It'd help if you could list as many characteristics of your input as possible. E.g. does the string <img occur outside the context of a valid image tag anywhere? How about alt=? Can tags span multiple lines? Complications like this are what make the problem impossible unless you place some additional restrictions on it. |
|
Dec 14 |
comment |
running script with “. ” and with “source ” @StephaneChazelas Yes, you are right. I added a note to clarify that it the above description is of the POSIX standard. |
|
Dec 14 |
comment |
Is there a way to put comments in an rsync --files-from file? I am not aware of any commenting mechanism for the files-from file. |
|
Dec 14 |
comment |
How to scp folders with nasty names using a shell function The idea is any argument to scp goes through two shells - first the local one and then remote one. Since shells strip quotes, if you need the remote shell to see quotes, you'll need to quote them so the local shell doesn't remove them. Not sure how uname is relevant? |
|
Dec 14 |
comment |
How to scp folders with nasty names using a shell function What part is unclear? I'm not sure I could explain it any better than what I said in the above comment. Maybe someone else can explain it better. |
|
Dec 14 |
comment |
How to scp folders with nasty names using a shell function You've stumbled on the correct solution. The special consideration with scp arguments is they have to be "double-quoted". This is because an scp argument, like any normal shell argument, is interpreted by your shell. However, once scp gets the argument, it has to pass it to a remote shell on the other machine, and the shell there interprets it once again. That is why two layers of quoting are required (\ and "). |