Bash for file processing I am writing a bash script to move all images into a central file.  I create the list of image files with:  img_fil='/home/files/img_dump.txt' locate -i image | grep \.jpg &gt; "$img_fil" locate -i image | grep \.jpeg &gt;&gt; "$img_fil" locate -i image | grep \.gif &gt;&gt; "$img_fil" locate -i image | grep \.tif &gt;&gt; "$img_fil" locate -i image | grep \.png &gt;&gt; "$img_fil"   But when I start processing the dump file for this, most of the paths contain blanks so this does not work:  while read -r fline do    if [ ! -e "$fline" ]; then       echo "F=&gt; $fline"       mv "$fline" "$img_dir"    else       fpath="$(dirname $fline)"       fname="$(basename $fline)"       echo "F=&gt; $fname P=&gt; $fpath"    fi  done   The dirname and basename always parse at the blanks so will not process right.  How do I get this to work?
Why does my shell script choke on whitespace or other special characters? Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?
Accidental indent in multicols environment It would be nice to be able to put emphasis on specific bits of a fragment or of a quote (bold can help for a quote but I find that it makes things less readable sometimes). What do you think? Update: On , you can highlight particular lines by prefixing each line with @@. See also: Basically, I want the header fonts to use a different (smaller) font size than the size I set using \documentclass. What should be the option I'd be using ?  \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[margin=1in, headsep=10pt]{geometry} \usepackage{fancyhdr} \pagestyle{fancy}  \fancyhead[L]{Personal Statement} % What other option should I use to get a custom font size ? How many and which are the uses of "const" in C++? As a novice C++ programmer there are some constructs that look still very obscure to me, one of these is const. You can use it in so many places and with so many different effects that is nearly impossible for a beginner to come out alive. Will some C++ guru explain once forever the various uses and whether and/or why not to use them? Under what conditions is the difference between a rank $1$, postive semidefinite matrix and a hermitian matrix positive semidefinite? What does a two overlapping circles symbol mean in an electrical schematic/diagram? In the datasheet for a A3503 Hall Effect Sensor, I saw a circuit diagram labeled 'Functional Block Diagram', and it shows a symbol I have not seen before. It's shown here between 3 - Output and 2 - Ground.  What is this supposed to represent?    The full datasheet is available prime divisor of $3n+2$ proof I have to prove that any number of the form $3n+2$ has a prime factor of the form $3m+2$. Ive started the proof  I tried saying by the division algorithm the prime factor is either the form 3m,3m+1,3m+2.  Case 1: $3m$      suppose $3m$ does divide $3n+2$. That means $3mr=3n+2$ where $r$ is some integer. But we get $mr-n= 2/3$ and since $mr-n$ is an integer that's a contradiction. Thus $3m$ does not work.  Case 2: $3m+1$ Same argument here  Case 3: $3m+2$ By the fundamental theorem of arithmetic every integer is divisible by a prime. But not sure what to do from here. Why isn't  generic?    Seems like Collection&lt;E&gt; could have boolean remove(E o);   Then, when you accidentally try to remove (for example) Set&lt;String&gt; instead of each individual String from a Collection&lt;String&gt;, it would be a compile time error instead of a debugging problem later. By "hand cipher", I mean a symmetric cipher for which encryption and decryption can can both be performed with a pencil on graph paper, consuming about 10-20 seconds per character by a proficient user. Additional simple tools, e.g. a deck of cards or a multiplication table, may be used to expedite the process. No mathematical proficiency is required other than mental addition, subtraction, and maybe multiplication.  Basically, it should be a cipher that someone of average mathematical abilities can master, and it should require no digital technology or cryptographic tools that cannot be constructed out of paper.  For example, four-square in CBC mode seems secure to me because CBC is a well established mode of operation and four-square seems to be a good block cipher as it accommodates large keys and seems to produce a random-looking output. However, the fact that four-square in CBC was never widely adopted before digital encryption became a consumer technology leads me to believe that someone broke the cipher and thus discouraged people from using it.  So is there any hand cipher that the best supercomputers would take years to cryptanalyze? If not, then for which hand cipher is the best known attack the most complex? Does installing and using Wine open up your Linux platform to Windows viruses? Contraction mapping in the context of $f(x_n)=x_{n+1}$. I'm interested in convergence of $f(x_n)=x_{n+1}$ and often hear this term referenced.  What does it mean to be a contraction mapping in the context of the sequence of real numbers given by $f(x_n)=x_{n+1}$? And what does it tell us about such sequence?  A search online gives the answer given by Wikipedia, that it is a function $f$ defined on a metric space $(M,d)$ from $M$ to itself with the property that for some real number $k \in [0,1)$,  $$d(f(x),f(y)) \leq k d(x,y)$$  This definition is quite unhelpful because I barely know what a metric space is. I feel like this definition is to generalized, and I'm interested in in the specific case of recursively defined real sequences $f(x_n)=x_{n+1}$ that there should be a more specific answer to my question. How to build a difference distribution table? How can I animate the Restrict Visibility property of an object? Comparing nullable column values using "IS NULL" versus "= NULL" I'm dealing with nullable values in a column of a table, i'm wondering why this:  with cte as (     select 'c1'::text as c1,null::text as c2     union     select 'c2'::text as c1,null::text as c2 ) select * from cte where c2 is null   returns a result set with the two "rows" having a null value in c2; comparting to this query:  with cte as (     select 'c1'::text as c1,null::text as c2     union     select 'c2'::text as c1,null::text as c2 ) select * from cte where c2 = null   that returns an empty result set!!  so it looks like that field is null is actually different from field = null? the question is... is there "null-compatible operator" to use? so i can write the comparision like: column_name = $1 and argument $1 can be a not null or null value. IF $1 is a null value then it will semantically equals to write as IS NULL, ELSE (if $1 is not a null value) then it would be semantically equals to = $1.  P.D: This question also applies to the case is NOT NULL versus &lt;&gt; NULL Possible Duplicate:          As a English non-native speaker it is difficult for me to understand when I must use present perfect or past simple because in my official language there isn't the present perfect tense. I know that present perfect is related to something that happened in the past but its result is important now. But for instance:        The message has been sent.   The message was sent.      Please help me point me out any examples/contexts where I should use 1. instead of 2. Can we make it more plain to recruiters that we're not open to relocation? The preference for being open to relocation is a checkbox, and if you don't check it, nothing about relocation shows up in your profile.  Evidently recruiters can't understand that a lack of "I am open to relocation" is the same thing as "I am not open to relocation", and so every single contact I've gotten through Careers is for a job that I would have to relocate for.  Can we make it more obvious to the recruiters (especially ones from Amazon) that we have not checked that box on purpose? Is there any hint of of the first Wizarding War being an international event? TZInfo::DataSourceNotFound error starting Rails v4.1.0 server on Windows Why do some questions not start with an auxiliary verb? When I learned English, my teachers told me that all questions must have an auxiliary verb at the beginning, just like Are you mad? or Is she playing? do.  But when watching some movies or talking with people who speak English, they just ask using things like You mad? and She’s playing?   Of course, the kind of intonation let me know they are asking a question, but why this happen? I've noticed a distressing tendency for questions that seem basic or overly short to be immediately closed and downvoted into oblivion.  Case in point:   Within a minute of being asked, this question received 12 downvotes and was closed as "not a real question".  That particular question is a very real, non-trivial question, but it had somewhat poor grammar and looked a little like a much simpler question.  Can we try to be a little more accepting?