In Linux, would it be possible to create a multi-pipe command, serving the same type of command ie: grep however different output alteration done to it?  Strict example:  grep 10-Feb file.txt | awk '{print $2}' | cut -d . -f 1,2 | sort | uniq -c | sort -rn | head -20 ;  grep 10-Feb file.txt | awk '{print $2}' | sort | uniq -c | sort -rn | head ;  grep 10-Feb file-txt [..]   Would it be possible to make the first grep and path an argument, and make it automatically apply to the following commands?   $=[grep 10-Feb file.txt] | awk '{print $2}' | cut -d . -f 1,2 | sort | uniq -c | sort -rn | head -20 ;  $ | awk '{print $2}' | sort | uniq -c | sort -rn | head ;  $ [..]   As an edit:  I cannot set-up the above command in a bash script since I have limited access to root from which I can call the scripts from.  I am interested in assigning a command as a variable from the command line solely.
I would like to use the same pipe for different applications, like in:  cat my_file | {   cmd1   cmd2   cmd3 }   Cmd1 should consume part of the input. Cmd2 should consume another part and so on.  However, each cmd eats more of the input then it read really needs due buffering.  For example:  yes | nl | {    head -n 10 &gt; /dev/null   cat  } | head -n 10   Outputs from line 912 instead of line 11.  Tee is not a good option, because each command is supposed to consume part of the stdin.   Is there a simple way to get this working?
Language hints for quoted code In  I tried to add  for syntax formatting to code blocks quoted from the question. However, it seems they won't be honoured if I write them as a comment in my own part of the post, and if I include the hint in the qutotation as well then I have some ugly empty space before the code block. There should be a way to write these things properly. Principled way of collapsing categorical variables with many levels? What techniques are available for collapsing (or pooling) many categories to a few, for the purpose of using them as an input (predictor) in a statistical model?    Consider a variable like  (discipline chosen by an undergraduate student). It is unordered and categorical, but it can potentially have dozens of distinct levels. Let's say I want to use major as a predictor in a regression model.  Using these levels as-is for modeling leads to all sorts of issues because there are just so many. A lot of statistical precision would be thrown away to use them, and the results are hard to interpret. We're rarely interested in specific majors -- we're much more likely to be interested in broad categories (subgroups) of majors. But it isn't always clear how to divide up the levels into such higher-level categories, or even how many higher-level categories to use.  For typical data I would be happy to use factor analysis, matrix factorization, or a discrete latent modeling technique. But majors are mutually exclusive categories, so I'm hesitant to exploit their covariance for anything.  Furthermore I don't care about the major categories on their own. I care about producing higher-level categories that are coherent with respect to my regression outcome. In the binary outcome case, that suggests to me something like linear discriminant analysis (LDA) to generate higher-level categories that maximize discriminative performance. But LDA is a limited technique and that feels like dirty data dredging to me. Moreover any continuous solution will be hard to interpret.  Meanwhile something based on covariances, like multiple correspondence analysis (MCA), seems suspect to me in this case because of the inherent dependence among mutually exclusive dummy variables -- they're better suited for studying multiple categorical variables, rather than multiple categories of the same variable.  edit: to be clear, this is about collapsing categories (not selecting them), and the categories are predictors or independent variables. In hindsight, this problem seems like an appropriate time to "regularize 'em all and let God sort 'em out". Glad to see this question is interesting to so many people! If I insert a flash drive and try to drag any files onto desktop - nothing happens.  Or from any other folder.  Drag 'n copy only works if you open desktop in nautilus ("show desktop in files").  I already ran the command:  gsettings set org.gnome.nautilus.preferences use-experimental-views false   It didn't help. How to fix this? Checking to see if a DateTime variable has had a value assigned How do we compare the size of numbers that are around the size of Graham's number or larger? When numbers get as large as Graham's number, or somewhere around the point where we can't write them as numerical values, how do we compare them?  For example:  $$G&gt;S^{S^{S^{\dots}}}$$  Where $G$ is Graham's number and $S^{S^{S^{\dots}}}$ is $S$ raised to itself $S$ times and $S$ is Skewes number.  It appears obvious (I think) that Graham's number is indeed larger, but how does one go about proving that if both numbers are "so large" that they become hard to compare?  More generally, how do we compare numbers of this general size?  As a much harder problem than the above, imagine a function $G(x,y)$ where $G(64,3)=$ Graham's number.  The function $G(x,y)$ is as follows:  $$G(x,y)=y\uparrow^{(G(x-1,y))}y$$  Where $G(0,y)$ is given.  I ask to compare $G(60,S)$ and $G(64,3)$ Why do birds sitting on electric wires not get shocked? Where is .bashrc? Calculate the Factor Group $(\mathbb{Z}_4 \times \mathbb{Z}_6)/\langle(0,2)\rangle$ Add an application to the command search path in csh Recently, I have installed an application (gnuplot) under user directory (/home/usr/bin). I want to run the application whenever I type 'gnuplot' in any directory. What could I do?  I tried to set the path in ~/.cshrc by  setenv gnuplot /home/usr/bin/gnuplot   but it doesn't work. It reports "command not found" as I type gnuplot in the terminal. Objects stuck in solid mode? I can't figure out what is causing this I tried removing the materials for the objects as well as re-assigning new materials and flipping normals I don't know what is causing this issue for the model.  The head seems to be working like it should but the body doesn't turn white in textured mode or black in material mode. I'm using default blender render Show that $C[a,b]$ is a complete space under the metric $d(f,g)=\sup_{t\in [a,b]}|f(t)-g(t)|$. How does the "tail" command's "-f" parameter work? $ tail -f testfile   the command is supposed to show the latest entries in the specified file, in real-time right? But that's not happening. Please correct me, if what I intend it to do is wrong...  I created a new file "aaa" and added a line of text and closed it. then issued this command (first line):  $ tail -f aaa xxx xxa axx   the last three lines are the contents of the file aaa. Now that the command is still running (since I used -f), I opened the file aaa via the GUI and started adding a few more lines manually. But the terminal doesn't show the new lines added in the file.  What's wrong here? The tail -f command only shows new entries if they are written by system only? (like log files etc) What is the value of $1^i$? $\,$ I already have the pink and red leather gloves, the armor, the crown, and the monkey's staff (and they're all enchanted). Regardless of how many health potions I use, I always die. Help! Evaluating the sum after reordering an infinite series $1-\frac {1} {2}+\frac {1} {3}-\frac {1} {4}+\ldots $ Consider this question on .  I put out a 200 bounty on the question, but did not get an answer from anyone other than myself that worked.    In fact, my answer is also the highest up-voted on it at this point.  I know that allowing OP's to retract a bounty can be a slippery slope; in fact I think that once the bounty is put up it should stay up.  But why not allow the OP to answer their own questions with a bounty and reward it to them if they receive the same up-votes as others?  Yes, I am fully aware that bounties are a risk.  People will use them for numerous reasons such as trying to draw extra attention to their issues.  However, in my specific question, the only valid answer is the one that I gave.  Had it been anyone else's question, I would have received the bounty, but since it was my own I did not. NFS: mount.nfs: Protocol not supported Clip for each feature I want to clip a polyline feature class by a polygon feature class (buffers created from points). Several polygons overlap, so I want to get each polygon feature clipped with each polyline feature.  Using the Clip_analysis tool, I get the orange lines:   whereas I want the following red lines:    In a python script, I tried the following code to clip every polyline with each polygon:          temp = arcpy.ValidateTableName("clip_temp")     bufferCursor = arcpy.SearchCursor(buffer)     n = 0     for pRow in bufferCursor:         arcpy.AddMessage(n)         feat = pRow.Shape         arcpy.Clip_analysis(inputPolylineLayer, feat, temp, "#")         if n == 0:             arcpy.Copy_management(temp, clip)         else:             arcpy.Append_management(temp, clip)         n=n+1   But the execution is very very slow and it crashes before finishing.  I also tried the Intersect_analysis tool but I didn't get the right geometries:   Do you have any idea of a better methods to do it? Infinite Series $\sum\limits_{n=1}^\infty\frac{x^{3n}}{(3n-1)!}$ How can we prove that? $$\sum_{n=1}^\infty\frac{x^{3n}}{(3n-1)!}=\frac{1}{3}e^{\frac{-x}{2}}x\left(e^{\frac{3x}{2}}-2\sin\left(\frac{\pi+3\sqrt{3}x}{6}\right)\right).$$  I think if we write the taylor expansion of $\sin(u)$ and $e^u$, we can arrive from RHS to LHS, but I am looking for a way to prove it from LHS. Is it possible to remove inline styles with jQuery?