12,472 reputation
12036
bio website
location
age 30
visits member for 4 years, 2 months
seen yesterday

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
Mar
29
comment Alias not working
Note that the command can be written in a slightly more straightforward way: ssh user@host git -C /var/www/blog/posts pull.
Mar
29
comment What is the different between “sudo su” and “sudo bash”?
You can use sudo tee for redirection with sudo rights.
Mar
23
comment VLC bash transcoding script destination directory
@Dezmond: I tried pasting and running it locally, and it worked. Check your pasting again. I'm running it with Dash as interpreter, which quickly breaks on anything non-standard, so I can't currently see where the syntax error could come from if it is pasted correctly. Note though that the script gives unexpected results if there are no matching files in the given directory, but that should make itself clear upon trying. So, write the script to e.g. the file transcoder.sh, make it executable: chmod +x transocer.sh and run it with ./transcoder.sh.
Mar
13
comment VLC bash transcoding script destination directory
@Dezmond: I think it is quite common for programs to fail if the path is not available. At least they should ask something like "The directory X does not exist, should it be created?" before doing it. That is the way e.g. Windows installers generally solve it; exactly how it is solved on a program to program basis varies.
Mar
12
comment VLC bash transcoding script destination directory
Does the target directory exist? VLC will probably not automatically create it for you.
Mar
12
comment Bash Script to repeat every word in a line?
OK, you can classify my comment as language confusion :-) .