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

2d
awarded  Enlightened
2d
awarded  Nice Answer
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
7
revised There are no repos
deleted 10 characters in body
Feb
5
reviewed Approve Bash - Check directory for files against list of partial file names
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
revised Bash - Check directory for files against list of partial file names
added 1173 characters in body
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
5
awarded  Nice Answer
Feb
4
revised Bash - Check directory for files against list of partial file names
added 11 characters in body
Feb
4
revised Bash - Check directory for files against list of partial file names
deleted 1 character in body
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
revised Bash - Check directory for files against list of partial file names
added 28 characters in body
Feb
4
comment Bash - Check directory for files against list of partial file names
Yes, that's an important difference. Fair enough :)
Feb
4
answered Bash - Check directory for files against list of partial file names
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?
Feb
4
reviewed Leave Open How do I change a variable of a background function?