Reputation
13,707
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
1 21 39
Newest
 Nice Answer
Impact
~860k people reached

May
5
comment How to tell apt that dependencies are resolved manually?
@DevSolar: Seems like someone serial-downvoted the question and both answers three years after-the-fact, without clarifying why. Best to just shrug and move on, I guess :-) .
Apr
6
comment How to break long lines in vim?
@Ben: Indeed it is easier; I will add it as the primary solution. I originally thought of having to select lines of at least a certain length as in the \%>60v solution, until I quickly realized that gww was a no-op on "short" lines, making the line length selection unnecessary. Still using the regexp matching to match "anything" should have raised a warning flag regarding more straight-forward solutions :-) .
Mar
30
comment How to break long lines in vim?
Looking through the manual, it is probably implied that the information given in :help last-pattern for normal searching applies to the :global command as well.
Mar
30
comment How to break long lines in vim?
@IngoKarkat: Ah, makes sense, since my last pattern during the tests was the line length aware one I demonstrated later. I will update the answer. Do you know where in the help this "empty pattern" behavior is mentioned? I can not trivially find it.
Mar
30
comment How to break long lines in vim?
@A.P.: Huh, works for me. I am using Vim 7.4.488-6 from Debian Unstable.
Jan
16
comment while loop condition - search for string pattern in bash
Also see How can I check whether a directory is empty or not? How do I check for any *.mpg files, or count how many there are? (Greg's Wiki)
Aug
19
comment Run python script on server over ssh session in the background persistantly
Look at GNU Screen, tmux, dtach, or similar programs.
Aug
12
comment Need to source bash_profile each time
Are you sure you are starting Bash and not some alternative shell (tcsh, zsh, …)? You can e.g. grep for your username in /etc/passwd to see your settings.
Aug
3
comment How do I move files out of nested subdirectories into another folder in ubuntu? (Trying to strip off many subfolders)
@pabouk: I meant to try it with find in combination with -exec echo {} + or -print0 | xargs -0 echo, but I was unclear. find will never deliver file name arguments in a form that can be misinterpreted as switches, since find will always prepend the file names with the path. In the case of files in the base directory, it will prepend ./, so the -- protection does not actually do anything here.
Aug
2
comment How do I move files out of nested subdirectories into another folder in ubuntu? (Trying to strip off many subfolders)
Neither xargs nor -exec + have issues with file names starting with - — just try it out with e.g. echo and see. Regarding portability, the -t switch to mv is a GNU extension anyway, and if the user has GNU mv, it most likely has GNU find and xargs (at least vice versa would be equally probable, so there would be no net gain in portability). I agree with the conclusion that -exec + usually is a more straightforward solution than -print0 | xargs -0, though.
May
27
comment LaTeX creates some long lines (longer than 'linewidth')
I can add that the situation where a line is not fully filled up is analogously called an "underfull hbox".
May
27
comment LaTeX creates some long lines (longer than 'linewidth')
@BaharS: Either the hint, or if you do not want it hyphenated, reword the sentence. The hyphenation algorithm in LaTeX is advanced and tries hard to work around these issues, so if it happens, it is for a reason. As a corollary, these kinds of rewordings are the very last thing one should do to avoid doubling the work in case one adds more information to the sentence anyway. If one is OK with hyphenation, the \- trick is alright. If the same word occurs in many places, one can add the hyphenation pattern once and for all with e.g. `\hyphenation{ex-em-pli-fy}, typically given in the preamble.
May
27
comment script to delete duplicate files using md5
If you properly indent your code it will be easier to read. Remove the space after h= on line 22 and after s= on line 29. Use $((b+a)) instead of expr to add $a and $b. Use e.g. for f in "$directory/*" instead of parsing ls output. Quote your variables. No need to mix between [ = ] and [ == ] — do you know the difference? Edit: I see that l0b0 was thinking along the same lines :-) .
Apr
29
comment Find particular file from extension from particular directory
Please include an actual example. It is really difficult to understand what you want at the moment, but an example is usually sufficient to explain such a task.
Apr
28
comment How to launch a bash script in another one?
@RaspDealer: You can set such privileges in the sudo configuration file via the visudo command. Read up on the syntax. There might also be annotated examples and further instructions in the file when it opens.
Apr
28
comment How to launch a bash script in another one?
The "test.sh done!" line will right now be written to the log directly after test.sh has forked; not when the command is actually done. You should rather have a second line like: (sudo ./temp.sh "$1" "$2" "$3" && echo "test.sh done!") >>/home/pi/test.log &. You still won't be able to provide credentials for sudo non-interactively, so you will need to give the Deluge user sudo privileges to execute test.sh without password authentication for your attempt to work.
Apr
9
comment How to print process id into statment
You have basic syntax errors for what you want to achieve. See e.g. stackoverflow.com/q/16072351/445621 for an example of command substitution into a shell variable.
Mar
31
comment VLC bash transcoding script destination directory
@Dezmond: "Locally" as in "on my computer". Try grabbing the script from pastebin.com/DhZ7yjsC instead; perhaps there is some issue with Stack Exchange code markup that I'm not seeing here.
Mar
29
comment Alias not working
@grawity: All right, I mostly use Mercurial in a similar way that has had such a switch for a long time. I looked it up for Git in the manual on my local system as I wrote the above, since I just assumed it would have a similar switch :-) . Stack Overflow has a question that confirms that it is quite recent; only since 1.8.5, actually.
Mar
29
comment What is the different between “sudo su” and “sudo bash”?
@EarthEngine: Just write cat <<EOF | sudo tee -a file, followed by content and a new EOF. Your order works as well. Also, the FAQ linked by @AvinashRaj explains the difference in sudo su and sudo bash further down: Special notes on sudo and shells