I have many files in a SRC folder. I would like to move all the files that follow a particular pattern from this SRC folder to another DST folder along with rename the file with a required extension.  Sample Parameters  SRC directory /Vinodh  Files in /Vinodh folder are TEST01, TEST02, TEST03, TEST04  TEST02 &amp; TEST03 contain the word WORLD  DST directory /TEST  I want to move the TEST02 &amp; TEST03 files to /TEST folder as TEST02.txt and TEST03.txt  I will be typing the command as   cd /Vinodh grep -l 'WORLD' *TEST* mv TEST02 /TEST mv TEST03 /TEST cd /TEST mv TEST02 TEST02.txt mv TEST03 TEST03.txt   I'd like to combine all this to a single line statement or have batch file that copies all the files in a single shot.
I am able to locate files in a folder containing a specific text string using this command:  grep -lir 'string' ~/directory/*   How do I move the files that appear in the above result to another location?
What is the best way to put a backdoor in an encryption system? How can you put a backdoor into an encryption algorithm? Are there any techniques that can be used to reduce the time it takes to break a key?  I am looking for practical examples encryption schemes that have backdoors, because they were designed to or new techniques exposed them. It is my understanding that you can use a lack of entropy and diffusion in block ciphers which will reduce the necessary time that it takes to break a key. This is especially true with s-boxes, which can be designed to not increase the strength of the key. As for one-way algorithms, using none-primes can make it easier to reverse keys. What are other decisions that can be made to make a broken encryption algorithm?   The goal is find examples that can be used for encryption pedagogy, by collecting a sample of weak ciphers to practice on. I have run a multiple linear regression using stepwise regression to select the best model, however the best model returned has a non-significant variable. When I remove this the AIC value goes up indicating the model without the significant variable is a worse fit. Should I remove the non-significant predictor or should I leave it in as it is a better model? I have some conditions for some background job to run:  condition-command &amp;&amp; condition-command &amp;&amp; background-job &amp;   The problem is: I want the conditions to block until the job runs, as if I had run:  condition-command; condition-command; background-job &amp;   But it isn't a condition, if previous command fails I do not want the job to run.  I realised it is asynchronous, but it should not, in my mind the both following scripts should be the same, but they do not:  sleep 2; echo foo &amp; sleep 1; echo bar; wait   # prints foo, then bar: correct sleep 2 &amp;&amp; echo foo &amp; sleep 1; echo bar; wait # prints bar, then foo: bug   I know if I test $? variable it would work, or if I put the last one inside a subshell (but then I would lost job controls, I want to avoid daemons), but I want to know why bash make it this way, where is it documented? Is there any way to prevent this behaviour?  Edit: Chained ifs is disgusting, that is why I will not accept it as a alternative way. Edit 2: I know a subshell is possible, but it will not work for me, let us imagine I want to run a bunch of commands then wait in the end. It will be possible if i check the existence of /proc/$PID directory, but it would be a pain in the neck if there are several jobs. Edit 3: The main question is WHY bash does it, where is it documented? Whether or not it has a solution is a bonus! Storing Images in DB - Yea or Nay? So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB.  What do you think are the pros/cons? Help with Spivak Calculus Ch3 Problem 6a Yet again I find myself stuck on a Spivak question. This time it is simply the question that isn't clear to me. It states:  If $x_1, ..., x_n$ are distinct numbers, find a polynomial function $f_i$, of degree $n-1$ which is 1 at $x_i$ and 0 at $x_j$ for $j\neq i$. Hint: the product of all $(x-x_j)$ for $j\neq i$, is 0 at $x_j$ if $j\neq i$. This product is usually denoted by: $$\prod_{\begin{smallmatrix}{j=1}\\ {j\neq i} \end{smallmatrix}}^n(x-x_j)$$  To be honest I don't know where to begin. I understand how to create a polynomial equation for a given set of results but this is quite strange. I'm not sure exactly what the author is expecting.  The answer book shows:  $$f_i(x)={\prod_{\begin{smallmatrix}{j=1}\\ {j\neq i} \end{smallmatrix}}^n(x-x_j)}/{\prod_{\begin{smallmatrix}{j=1}\\ {j\neq i} \end{smallmatrix}}^n(x_i-x_j)}$$  Which I have expanded out just fine but don't know what to do with. Make HttpURLConnection load web pages with images I'm having trouble with \includegraphics I'm using MacTeX Firstly and fore-mostly I am a complete new comer to the world of LaTeX and so please do bear with me. I will try to be as accurate as I can but if you need any more info please let me know.  All I want is to figure out how to import a graphic into LaTeX (MacTeX).  I am using the following in my code:  \documentclass[10pt,a4paper,draft]{report} \usepackage{graphicx}   Then in my document section I'm using   \begin{figure} \includegraphics[width = 50mm]{Name.jpg} \caption{Label} \end{figure}   Once I compile the document, the area for the picture has been allocated but there is no image, I have tried .png and .pdf files also.  I know that this is a very simple question and I hope there is a simple solution but I cannot find anything on the net about this (which may mean I'm being dim).  Also I'm using Latexian but I have tried 4 different editors and it doesn't work in any. Help us test the shiny new "User Activity" page! (Plus a bunch of new features.) Node Package Manager got corrupted in some way, now it cannot be installed I ran into a problem today when I decided to use npm update -g in a nodejs app directory. This was a bad decision, because it caused me to run into a .   The solution is to reinstall nodejs and npm. Unfortunately when I go to install npm using sudo apt-get install npm it doesn't work.  The full error in the terminal is here:  Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that  some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies:  npm : Depends: nodejs but it is not going to be installed    Depends: node-abbrev (&gt;= 1.0.4) but it is not going to be installed    Depends: node-ansi but it is not going to be installed    Depends: node-archy but it is not going to be installed    Depends: node-block-stream but it is not going to be installed    Depends: node-fstream (&gt;= 0.1.22) but it is not going to be installed    Depends: node-fstream-ignore but it is not going to be installed    Depends: node-github-url-from-git but it is not going to be installed    Depends: node-glob (&gt;= 3.1.21) but it is not going to be installed    Depends: node-graceful-fs (&gt;= 2.0.0) but it is not going to be installed    Depends: node-inherits but it is not going to be installed    Depends: node-ini (&gt;= 1.1.0) but it is not going to be installed    Depends: node-lockfile but it is not going to be installed    Depends: node-lru-cache (&gt;= 2.3.0) but it is not going to be installed    Depends: node-minimatch (&gt;= 0.2.11) but it is not going to be installed    Depends: node-mkdirp (&gt;= 0.3.3) but it is not going to be installed    Depends: node-gyp (&gt;= 0.10.9) but it is not going to be installed    Depends: node-nopt (&gt;= 2.1.1) but it is not going to be installed    Depends: node-npmlog but it is not going to be installed    Depends: node-once but it is not going to be installed    Depends: node-osenv but it is not going to be installed    Depends: node-read but it is not going to be installed    Depends: node-read-package-json (&gt;= 1.1.0) but it is not going to be installed    Depends: node-request (&gt;= 2.25.0) but it is not going to be installed    Depends: node-retry but it is not going to be installed    Depends: node-rimraf (&gt;= 2.2.2) but it is not going to be installed    Depends: node-semver (&gt;= 2.1.0) but it is not going to be installed    Depends: node-sha but it is not going to be installed    Depends: node-slide but it is not going to be installed    Depends: node-tar (&gt;= 0.1.18) but it is not going to be installed    Depends: node-which but it is not going to be installed E: Unable to correct problems, you have held broken packages.   What can I do to get npm properly installed and running again?  Thanks. Seeking feedback on downvoted question? How fast does the sequence $y_t$ defined by $y_{t+1}=y_t(1-y_t)$ decay to zero? The question is in the title; I'm looking for the exact decay rate. Naturally, assume the starting point $y_0$ belongs to $(0,1)$.   This is motivated by one of the answers to . I need another LP-E5 type battery for my Canon 450D. Should I buy an original Canon battery or one of the many generic brands available? There are loads of cheapos on , for example.  I should add that the new battery will be added to my existing Canon battery in a battery grip.  Does anyone have any experience (good or bad) of using generic batteries? Matryoshka words Since it's Friday and others are playing games, here's another one to take us into the weekend.  Everyone knows about those Russian nesting dolls (called matryoshka dolls, I believe). A small doll nests inside a larger, which itself is inside a larger doll, and so on.   This game does the same with words. You start with a three-letter word, add a letter to make another word, and so on. Longest word wins. The catch? Each additional letter has to form a legitimate word.  Here's one to start you off:     bur   burr   burro   burrow   burrows     Good luck. How can I make Windows Paint save by default as JPEG format? Double booked - User bookmarking question recorded twice In this  one user is shown as having bookmarked  twice:  This doesn't appear to be the same question as:  or  though it's certainly possible that the cause is the same. Set title for each terminal tab in gnome-terminal using a bash script I'm using Ubuntu 16.04  I want to open multiple terminal tabs, run commands and set title. I can open multiple tabs with this command:  gnome-terminal --tab -e "command1" --tab -e "command2"   but cannot use --title option as it is not available in this version.   I know mate-terminal can do this, but I want to use gnome-terminal.   I've applied solution posted  and it worked but when i run  gnome-terminal --tab -e "bash -c 'set-title 99;ping 192.168.7.99'"   It shows:  bash: set-title: command not found PING 192.168.7.99 (192.168.7.99) 56(84) bytes of data. 64 bytes from 192.168.7.99: icmp_seq=1 ttl=128 time=0.425 ms 64 bytes from 192.168.7.99: icmp_seq=2 ttl=128 time=0.353 ms 64 bytes from 192.168.7.99: icmp_seq=3 ttl=128 time=0.335 ms   I also applied   I've also read this post  but the accepted answer did not solve my issue in 16.04 os or gnome-terminal version 3.18.3 and other solution provides to use other terminal xterm and I want to use gnome-terminal. Literature with Biber generates strange citations: firstnames appear erratically I had been using bibtex and then biblatex for quite some time. For the newest edition of my book I moved to biber. I happened t notice that firstnames are sometimes generated and sometimes not. Has this been observed by others?   I have tried to make a minimal example but without success. Using the following code, which shows all the commands related to biblatex I have in my preamble I could not get the firstnames to be shown. Even with the stylefile I made for this book (second line) the error did not occur.  I have a dropbox with the latex files for the book available. I can give access to these.   What do you propose?  \documentclass[fontsize=10pt,twoside]{scrbook} \usepackage{hormonbuch} \usepackage[%   style=authoryear%   ,natbib=true%   ,sorting=nyt,backend=biber,doi=false,isbn=false,url=false]{biblatex} \addbibresource{../Literatur/EndokrinologieKundeNourl.bib}  \renewcommand*{\bibpagespunct}{\addcolon} \DeclareFieldFormat{pages}{#1}  \renewrobustcmd*{\enquote}{}  \renewbibmacro{in:}{%       Herbert Voss auf http://tex.stackexchange.com/questions/10682/suppress-in-biblatex   \ifentrytype{article}{}{%   \printtext{\bibstring{in}\intitlepunct}}}  \renewbibmacro*{journal+issuetitle}{%   \usebibmacro{journal}%   \setunit*{\addspace}%   \iffieldundef{series}     {}     {\newunit      \printfield{series}%      \setunit{\addspace}}%   \usebibmacro{volume+number+eid}% %  \setunit{\addspace}%   \newunit}  \renewbibmacro*{volume+number+eid}{%   \printfield{volume}% %  \setunit{\addcolon\space}%   }% % \renewbibmacro*{note+pages}{%   \printfield{pages}%   \newunit} % \begin{document}  \citet{CRT+88,FDe+85} \citep{CRT+88,FDe+85} \cite{CRT+88,FDe+85}  \printbibliography  \end{document} Under what condition we can interchange order of a limit and a summation? When I use , the results I get don't reflect recent activity. Sometimes the data I get back are two months out of date. What's wrong? This is intended to be a canonical reference for questions about SEDE not reflecting real-time results. Stored Procedures, MySQL and PHP The question is a fairly open one. I've been using Stored Procs with MS SQLServer for some time with classic ASP and ASP.net and love them, lots.  I have a small hobby project I'm working on and for various reasons have gone the LAMP route. Any hints/tricks/traps or good starting points to get into using stored procedures with MySQL and PHP5? My version of MySQL supports Stored Procedures.