Reputation
32,998
Next tag badge:
840/1000 score
167/200 answers
Badges
4 61 107
Newest
 Enlightened
Impact
~1.9m people reached

Feb
8
comment failed to fetch files
Please edit your question and explain what you were doing. We need to see the exact command you ran that gave this error. Also tell us what version of Ubuntu you are using.
Feb
8
comment script to move files from downloads to other folder (every time a file goes to the download folder)
How would files be added to the folder? Why don't you chose where to save the file at the time you're downloading it? Do you really want to have a process continuously watching the downloads folder and have it pop up a window every time a new file appears?
Feb
5
comment Bash - Check directory for files against list of partial file names
@alexis yes, you're quite right. I did some testing and this becomes very slow if the number of UUIDs/files increases. I added a perl approach (which can be run as a one liner from within th bash script, so technically, still bash if you're open to some creative naming) which is far faster.
Feb
5
comment Bash - Check directory for files against list of partial file names
@alexis I don't see what you mean by " pass it to the script as a second argument". Pass what? The $source_dir? Why 2nd argument? There's no $1 here. Also, the OP states in the question that this is just a part of a larger script and the ${source_directory} is defined earlier. As for speed, this will be pretty fast. The limiting factor will be the number of uuids, not the number of target files. Are you thinking of storing all directory names as keys in an associative array and then querying it for each uuid?
Feb
4
comment Bash - Check directory for files against list of partial file names
@Arronical sure, see updated answer. You can use ${source_directory} just like you were doing in your script.
Feb
4
comment Bash - Check directory for files against list of partial file names
Yes, that's an important difference. Fair enough :)
Feb
4
comment Bash - Check directory for files against list of partial file names
@muru ah, yes, that's true. The OP seemed to want a different logic though and I don't see anything wrong with the approach's logic.
Feb
4
comment Bash - Check directory for files against list of partial file names
Nice (+1), but why is this better than what the OP was doing? You seem to be doing the same basic thing but in two steps instead of one.
Feb
4
comment Bash - Check directory for files against list of partial file names
I don't really see what's wrong with what you have. You will need to loop through either the UUIDs or the files, why would one loop be better than the other?
Jan
31
comment “which” command is not showing anything on standard output
Please don't post screenshots of your terminal. Just copy/paste it directly into your question and use the formatting tools to make it look good.
Jan
29
comment Automatically download/torrent files in Ubuntu 14.04
So what is your actual question? Are you expecting us to just write the entire script for you?
Jan
29
comment Keyboard shortcut for ruby script
@Vildnex well yes, that's because you need things that you are setting in your shell's configuration files. Please edit your question and explain that/. We need to know all relevant details. In the meantime, try changing the command to bash -c ". ~/.bashrc && ~/ums.rb > note.txt && gedit note.txt && rm note.txt"
Jan
29
comment Logging script output to a file
@Afshin.Hamedi fixed, thanks.
Jan
29
comment Generate a separate .md5 file for each .fastq file in a directory?
Hang on, are your files *fastq or *fastq.gz?
Jan
27
comment I forgot my passwowd and my administrative account will not reset (password recovery)?
Please edit your question and explain exactly what happened, what you did, what you tried, how it failed. What do you mean by your "account has been reset"?
Jan
26
comment Script crashes when starting from .desktop file
Thanks. Could you please answer my other questions as well? edit your question and add the answers there. Also, the script you show will attempt to run module and stop the first time it launches it successfully. What is it that crashes? What are you expecting to happen and what actually happens?
Jan
26
comment Script crashes when starting from .desktop file
Can you show us a minimal example of your script that reproduces the problem? What do you mean by "It runs at first but then crashes."? Does it run correctly but it stops after a while? Does it run the first time you try but not the second? Does the gksu dialog appear? Please edit your question and clarify.
Jan
25
comment “$: command not found ” is printed each time at the top of the terminal when I start it. Why is it doing so?
@Raphael the $- variable has the current set of bash options. On my system, for example, echo $- returns himBH where the i means that we're running an interactive shell (see the explanation of the set builtin in man bash for the rest). In a non-interactive shell (such as what is launched to run a shell script), $- won't contain i. The case statement, therefore, tests for the presence of i in $- as a way of determining whether this is an interactive shell or not.
Jan
25
comment Is the scanner Canon Pixma MG2450 working in Ubuntu?
@cipricus every site on SE is against cross-posting. That is mentioned in various places on the main meta and that includes AU. U&L is more strict than most but pretty much every site is against it. That said, your question on U&L mentions other distros and has more detail and, as I explained in my answer on the relevant meta post, doesn't really qualify as cross-posting.
Jan
24
comment How can I reduce the idle RAM usage of Ubuntu?
Are you sure it's a problem? Have a look at linuxatemyram.com