I noticed someone is shooting downvote on my answer and questions recently, and well like as always with no comment for the reason. and I don't find anything wrong in my question or answer at all
@αғsнιη sorry to hear! Happily, it won't affect any of the privileges you've earned at U&L, and hopefully the "fraudulent vote" script reverses it within the next 24 hours.
I guess someone is unhappy with my downvotes when I leave comments when reviewing from the review queue or saw a bad or wrong answers/questions and I think they ended uphappy from my downvotes for their posts
and I think 'these are kind of revenge for them, don't know
@αғsнιη yeah, don't worry about it, you did the right thing: you checked your answer to see if there's anything you can improve. That's all you can do.
And I will repeat the advice I gave a while back to another user:
@cuonglm Maybe they don't like your username. Perhaps they didn't understand your answer. Maybe they are having a bad day. Or they thought they were clicking a different post. They might have done it by accident. They might have thought you were someone else. They might always downvote users whose name starts with a c. Who knows? It's never worth it to worry about downvotes unless there is something wrong with your answer.
right; we each only get one vote per post, so the damage is somewhat limited. If they're targeting you, let us know and we can raise a ticket to have it investigated by the people who have access to the votes, and take it from there
(targeting = the downvotes continue across your posts)
Are you sure about this @αғsнιη? You seem to have almost no downvotes at all! Looking at your profile, there is one downvote today and one yesterday. The next downvote before that is all the way on December 19th!
You also have two "unupvotes", which would appear like negative rep changes, but are just someone removing an existing upvote, but not actually downvoting.
thank you dears, I'm not unhappy with downvotes, the only thing that it makes me upset is that I think they do downvote as result of because I downvoted for them (but I said my downvote reason)
@terdon yes, one yesterday and one today and downvote for some older posts immediately (or very close) after I had a downvote for someone's post. I won't ever say downvotes are from them because nothing is visible to me
and that removed 10 is for my deleted answer I deleted by myself because another answer was good
thank you @JeffSchaller @terdon to hearing me, appreciated.
@JeffSchaller every time there is an election people suddenly become intimately concerned with all the issues that have remained constant and ignored for the previous 3 years
yeah, that's unfortunate violence in the middle of a political event, I suppose. hard to distentangle, but I hope no one was/will be hurt. I sure hope it's not the end of America.
I was just trying to be fair and keep political discussions to a minimum (per the previous November US Election hubbub). I was blissfully unaware of this recent violence.
my "no politics" statement was in reply to "the United States of America is a failed state", which sounded like it was heading in a political direction
Can a vim power user tell me why the substitute command s/$HOME\/directory\/subdirectory\//\/run\/media\/user\/drive\/directory\/subdirectory\// causes the error E486: Pattern not found: $HOME\/directory\/subdirectory\/ when lines such as destDir=$HOME/directory/subdirectory/"another_subdirectory" in the file clearly contain that pattern?
@BlackPanther the $ is special to "vim", as the "end of line" marker. There can't be text after the end of the line, so that's why it doesn't match anything.
Aah, I see, thanks. I didn't think I needed to escape it because searching with regular expressions in vim using / includes $ without me having to escape it
@BlackPanther worked fine for me, given your data above. As Mr. Homer suggested, you could make it more readable by avoiding "leaning toothpick syndrome" and do something like s!\$HOME/directory/subdirectory/!/run/media/user/drive/directory/subdirectory/!
@MichaelHomer it worked, I forgot to prepend the substitute command with the % symbol that tells it to perform a find and replace in all lines in the file
@JeffSchaller Now I use the % prefix before the substitute command, I don't even have to escape the dollar sign in the search part of the regular expression
that looks equivalent; I'd offer two suggestions: (1) any errors from cp will escape both the |tee and the >>; (2) consider putting the >> redirection outside of the loop so that the shell doesn't have to reopen the file each time -- but only if you want to capture all of the command output inside the loop.
@JeffSchaller I see, is that because tee and >> don't deal with the standard error stream?
> that looks equivalent; I'd offer two suggestions: (1) any errors from cp will escape both the |tee and the >>;
Does any error output end up on the command line when the script is executed?
> (2) consider putting the >> redirection outside of the loop so that the shell doesn't have to reopen the file each time -- but only if you want to capture all of the command output inside the loop.
The only other command in the loop is the shift shell built-in. Does this also create an output? I'm not sure whether shell built-ins create an output.
If I redirect the output of cp to a file using the command:
cp -v -r "$1"/* "$dest" >> "$log_file"
Will the verbose ouput of the cp command called in the bash script be printed to the standard output in addition to being redirected to a log file?
@BlackPanther they don't even see the stderr stream; shift should not create any output, no. (2) is just a minor performance improvement suggestion; do it only if you care about speeding up the I/O a bit
@JeffSchaller I want the output of cp to be persisted to a file, and I also want to follow the same output in the terminal. tee does this, I'm guessing that replacing tee with >> does not achieve this goal since >> redirects the output of a command, >> does not duplicate the output of a command like tee does. Is this right?
@JeffSchaller Great information. To implement (2), do I just put >> (i.e. move >> "$log_file") after the done keyword of the loop?
@JeffSchaller Thanks. So cp -v -r "$1"/* "$dest" >> "$log_file" would not print cp's output to the terminal, but cp -v -r "$1"/* "$dest" | tee -a "$log_file" would?