I'm new to bash (ksh only up until now). I'm struggling with whitespace being striped from variables.  I've read a number posts on bash's treatment of leading whitespace but I'm not sure how to correct it in my example.  echo "No space"         &gt; x.tmp echo "     Some space" &gt;&gt; x.tmp cat x.tmp cat x.tmp | while read line do    echo "$line" &gt;&gt; y.tmp done cat y.tmp   Output:  No space      Some space No space Some space   What do I need to do to preserve the whitespace?  Thanks.
Say I have this file:  hello world hello world   This program  #!/bin/bash  for i in $(cat $1); do     echo "tester: $i" done   outputs  tester: hello tester: world tester: hello tester: world   I'd like to have the for iterate over each line individually ignoring whitespaces though, i.e. the last two lines should be replaced by  tester: hello world   Using quotes for i in "$(cat $1)"; results in i being assigned the whole file at once. What should I change?
Noetherian property for exact sequence Let $0 \to M' \xrightarrow{\alpha} M \xrightarrow{\beta} M'' \to 0$ be an exact sequence of $A$-modules. Then $M$ is Noetherian is equivalent to $M'$ and $M''$ are Noetherian.  For the ''$\Leftarrow$'' case:  I guess if we let $(L_n)_{n\geq 1}$ be an ascending chain of submodules of $M$, then $(\alpha ^{-1}(L_n))_{n\geq 1}$ is a chain in $M'$, and $(\beta(L_n))_{n\geq 1}$ is a chain in  $M''$. For large $n$ both these chains are stationary. Then why we know the chain $(L_n)$ is stationary?   Thanks! How to check if jQuery.ajax() request header Status is "304 Not Modified"? Experiment to find structure of water Who first determined the structure of water (two hydrogen atoms stuck to an oxygen atom at approx 105 degrees), and, more importantly, how was this done? Where is the "Add vector layer"-button in GRASS 6.4.4. plug-in QGIS 2.10.1? I've just downloaded and installed the new version of QGIS 2.10.1 with GRASS 6.4.4.  When opening a new GRASS mapset and importing layers, I missed the button "Add a new vector layer". I've updated the GRASS plugin, but again the button wasn't there (all other GRASS symbols except "add raster layer" were visuable).  It's maybe a stupid question of a GIS beginner, but what can I Do? Is there an option to add (not import) a vector layer via the GRASS toolbox? After 4 years of being a Mac user, there is only one thing that I still miss from the Windows world, and that is being able to switch with a single keystroke between all open windows in the computer.  What is the best app or utility, free or not, for accomplishing that?  I've used , but I never was completely satisfied with it. It's a bit slow and the switcher UI is not very pretty.  Do you know any alternative?    EDIT (2016): This question keeps getting views and upvotes after 6 years. When I asked this question in 2010 I was still transitioning from being a Windows user. Eventually, I got used to Mac OS X UI and nowadays I don't use any third party utility for managing app windows, just Mission Control and the native keyboard shortcuts. So, although this question is no longer relevant for me I hope it is useful to new Mac users making the switch (Including this comment). Eclipse CDT - Copy static resource file to bin_dir Suppose $X$ is a finite set and $f : X \to X$ is a function. Then $f$ is injective if and only if $f$ is surjective. I was coding a physics simulation, and noticed that I was using discrete time. That is, there was an update mechanism advancing the simulation for a fixed amount of time repeatedly, emulating a changing system.  I though that was interesting, and now believe the real world must behave just like my program does. It is actually advancing forward in tiny but discrete time intervals? Picklist dependent on 2 controlling picklist longtabu and color compatibility Is there a word for saying "um" or "uh", etc, during speaking?  Or a word for "um" and "uh", etc? I want to clear the inputtext used to search, and clear all search results using a commandbutton. I tried the following on the 'Reset' button I added but it only clears the inputtext and the search results are not clearing.  &lt;apex:pageBlockSectionItem &gt;                     &lt;apex:outputPanel layout="block" Rendered="true"&gt;                     &lt;apex:inputText value="{!ReportSearchString}" /&gt;                     &lt;apex:commandButton value="Search" action="{!searchReports}" reRender="ReportSearchResults, "/&gt; &amp;nbsp;&amp;nbsp;                      &lt;apex:commandButton value="Back" action="{!BackToCreateFeedPage}"/&gt;&amp;nbsp;                     &lt;apex:commandButton value="Reset" onclick="this.form.reset();return false;"/&gt;                     &lt;/apex:outputPanel&gt;                 &lt;/apex:pageBlockSectionItem&gt;                             &lt;/apex:pageBlockSection&gt;                         &lt;apex:pageBlockSection id="ReportSearchResults"&gt;                 &lt;apex:outputText value="{!warningMessage}" rendered="{!!showTable}" /&gt;                 &lt;apex:pageBlockTable value="{!reportList}" var="item" rendered="{!showTable}"&gt;                     &lt;apex:column headerValue="Report Name" &gt;                         &lt;apex:commandLink value="{!item.Name}" action="{!BackToCreateFeedPage}"&gt;                             &lt;apex:param value="{!item.Id}" name="SelectedReport" assignTo="{!selectedReportId}" /&gt;                         &lt;/apex:commandLink&gt;   This is my search function, it works fine. I need to clear the results of this search on clicking 'Reset' button.   public void searchReports()     {         showTable = false;               reportList = new List&lt;Report&gt;();          reportSearchResult = new Map&lt;Id, Report&gt;();          selectedReport = new Report();         if((ReportSearchString != null &amp;&amp; ReportSearchString != '') &amp;&amp; ReportSearchString.length() &gt;= 3)         {             reportSearchResult = new Map&lt;Id, Report&gt;([Select Id, Name From Report Where Name Like :'%'+ReportSearchString+'%' limit 2000]);              warningMessage = 'No Result Found';         }         else         {             warningMessage = 'Search text should have atleast 3 characters';         }     } lstlisting - line number gaps Is it possible to add non-number characters on the left of a code block?  Specifically, I want to add ... to correspond with some source code (see image).    I am currently using commands to stop / start the line numbers. Here is the code:  \documentclass[12pt]{article}  \usepackage[a4paper, margin = 20mm, top = 30mm, bottom = 25mm]{geometry} \usepackage{xcolor, soul} \usepackage{listings}  \definecolor{codebackground}{rgb}{0.95, 0.95, 0.92}  \lstset {     frame            = tb, % hrule above and below     keepspaces       = true,     columns          = flexible,     basicstyle       = {\normalsize\ttfamily},     escapeinside     = {(*@}{@*)}, % for escaping     backgroundcolor  = \color{codebackground},     showstringspaces = false,     language         = C,     keywordstyle     = \color{blue},     stringstyle      = \color{red},     commentstyle     = \color{teal},     numbers          = left, % {none, left, right}     firstnumber      = 1,     numberstyle      = \scriptsize\color{black},     numbersep        = 5pt }  \let\origthelstnumber\thelstnumber \makeatletter % for stopping line numbers \newcommand*\stopnumber {     \lst@AddToHook{OnNewLine}     {         \let\thelstnumber\relax         \advance\c@lstnumber-\@ne\relax     } } % for starting line numbers \newcommand*\startnumber[1] {     \setcounter{lstnumber}{\numexpr#1-1\relax}     \lst@AddToHook{OnNewLine}     {         \let\thelstnumber\origthelstnumber         \refstepcounter{lstnumber}     } } \makeatother  \begin{document} \begin{lstlisting}[firstnumber = 456] int third_function(const int c) {     /* error checking */     if(c &lt; 0)     {         return;     } (*@ \stopnumber @*)      ...     (*@ \startnumber{512} @*)     /* other stuff */     int d = 4;     char* word = "third function"; (*@ \stopnumber @*)      ...     (*@ \startnumber{678} @*)     return (c * d); } \end{lstlisting} \end{document} Supernatural sites on Stack Exchange Is there any Q&amp;A site under the Stack Exchange network where we can discuss about supernatural incidents? If not, then whom should I petition to create it? I am developing an application and can not figure out a proper abstract term that would fit an interface that defines an object as Movable and Resizable (In essence, something that has a defined size and defined position). Calling it Movable and resizable is kind of silly. Layout was a term that came to my mind but it is not good as layout is something that is responsible for defining position and size, not containing it. Thanks a lot. Is there a command for large middle delimiters consistent with \bigl and \bigr? After browsing through related threads, I am now of the understanding (please correct me if I am wrong) that the rule of thumb is to use the \bigl,\bigr pair with brackets, parentheses, etc. for operators like sums, products, and integrals, and \left,\right in all other cases.  I only recently found out about \middle , which has solved what had been a vexing problem for me: delimiters for function arguments (slashes, bars) not scaling properly. Leafing through my cheatsheet has not been of much help, so I wish to ask: is there an equivalent of \middle for \bigl and \bigr, or would the use of \middle along with that pair not be gauche? Calculating well densities in selected counties using ArcPy? Detect if program is running with full administrator rights What do you call exaggerations like "I'm starving"? For example, when you are a little hungry and you say "I'm starving", or when you are so tired and you say "I'm dying". What do you call these type of expressions? Just exaggerations? I don't know how to explain this better. Does $\lim_{n\to \infty} \int^{\infty}_{-\infty} f_n(x) dx\, = \int^{\infty}_{-\infty} f(x)\,dx\,$? If $\displaystyle\{f_n(x)\}$ is sequence of continuous function on $\mathbb{R}$ converging uniformly to $f(x)$, then does $\displaystyle\lim_{n\to \infty} \int^{\infty}_{-\infty} f_n(x) dx\, = \int^{\infty}_{-\infty} f(x) dx\,$ hold? I know  it holds if we integrate over an interval of the form $[a,b]$ but not sure about improper integral!