Skip to content

Commit e8dee97

Browse files
added meta tags for mini blog posts
1 parent 8527f05 commit e8dee97

File tree

11 files changed

+11
-11
lines changed

11 files changed

+11
-11
lines changed

mini/bash-compound-commands-redirection/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html><html lang=en><head><meta content="IE=edge" http-equiv=X-UA-Compatible><meta content="text/html; charset=utf-8" http-equiv=content-type><meta content="width=device-width,initial-scale=1.0,maximum-scale=1" name=viewport><title>Bash compound commands and redirection</title><link href=https://learnbyexample.github.io/atom.xml rel=alternate title=RSS type=application/atom+xml><script src=https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js></script><link href=https://learnbyexample.github.io/site.css rel=stylesheet><meta content=learnbyexample property=og:title><meta content=website property=og:type><meta content="Learn Python, Regex, Linux, Scripting, Vim, Ebooks, Self-Publishing and Interesting Tech Nuggets." property=og:description><meta content=https://learnbyexample.github.io property=og:url><meta content=https://learnbyexample.github.io/images/learnbyexample.png property=og:image><meta content=1280 property=og:image:width><meta content=640 property=og:image:height><meta content=summary_large_image property=twitter:card><meta content=@learn_byexample property=twitter:site><link href=https://learnbyexample.github.io/favicon.svg rel=icon><link rel="shortcut icon" href=https://learnbyexample.github.io/favicon.png><body><div class=container><div class=mobile-navbar id=mobile-navbar><div class=mobile-header-logo><a class=logo href=/>learnbyexample</a></div><div class="mobile-navbar-icon icon-out"><span></span><span></span><span></span></div></div><nav class="mobile-menu slideout-menu slideout-menu-left" id=mobile-menu><ul class=mobile-menu-list><li class=mobile-menu-item><a href=https://learnbyexample.github.io/books> Books </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/mini> Mini </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tips> Tips </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tags> Tags </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/about> About </a></ul></nav><header id=header><div class=logo><a href=https://learnbyexample.github.io>learnbyexample</a></div><nav class=menu><ul><li><a href=https://learnbyexample.github.io/books> Books </a><li><a href=https://learnbyexample.github.io/mini> Mini </a><li><a href=https://learnbyexample.github.io/tips> Tips </a><li><a href=https://learnbyexample.github.io/tags> Tags </a><li><a href=https://learnbyexample.github.io/about> About </a></ul></nav></header><main><div class=content id=mobile-panel><article class=post><header class=post__header><h1 class=post__title><a href=https://learnbyexample.github.io/mini/bash-compound-commands-redirection/>Bash compound commands and redirection</a></h1><div class=post__meta><span class=post__time>2022-06-04</span></div></header><div class=post-content><p>I've been using Linux for about 15 years. There are a lot of features I don't know and some that I've used but not often enough or to the full extent of possibilities.<p>Recently, I had written a <code>bash</code> function, which required saving the output of a <code>for</code> loop to a file. I knew that <a href=https://www.gnu.org/software/bash/manual/bash.html#Compound-Commands>compound commands</a> support <a href=https://www.gnu.org/software/bash/manual/bash.html#Redirections>redirection</a>, but it didn't strike me at that time as I haven't had to use them often.<p>Here's a simplified version of the function I wrote first:<pre class=language-bash data-lang=bash style=background-color:#f5f5f5;color:#1f1f1f;><code class=language-bash data-lang=bash><span style=color:#c23f31;>pf</span><span>()
1+
<!doctype html><html lang=en><head><meta content="IE=edge" http-equiv=X-UA-Compatible><meta content="text/html; charset=utf-8" http-equiv=content-type><meta content="width=device-width,initial-scale=1.0,maximum-scale=1" name=viewport><title>Bash compound commands and redirection</title><link href=https://learnbyexample.github.io/atom.xml rel=alternate title=RSS type=application/atom+xml><script src=https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js></script><link href=https://learnbyexample.github.io/site.css rel=stylesheet><meta content="Bash compound commands and redirection" property=og:title><meta content=website property=og:type><meta content="Using stdout redirection on the output of a Bash for loop." property=og:description><meta content=https://learnbyexample.github.io/bash-compound-commands-redirection/ property=og:url><meta content=@learn_byexample property=twitter:site><link href=https://learnbyexample.github.io/favicon.svg rel=icon><link rel="shortcut icon" href=https://learnbyexample.github.io/favicon.png><body><div class=container><div class=mobile-navbar id=mobile-navbar><div class=mobile-header-logo><a class=logo href=/>learnbyexample</a></div><div class="mobile-navbar-icon icon-out"><span></span><span></span><span></span></div></div><nav class="mobile-menu slideout-menu slideout-menu-left" id=mobile-menu><ul class=mobile-menu-list><li class=mobile-menu-item><a href=https://learnbyexample.github.io/books> Books </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/mini> Mini </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tips> Tips </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/tags> Tags </a><li class=mobile-menu-item><a href=https://learnbyexample.github.io/about> About </a></ul></nav><header id=header><div class=logo><a href=https://learnbyexample.github.io>learnbyexample</a></div><nav class=menu><ul><li><a href=https://learnbyexample.github.io/books> Books </a><li><a href=https://learnbyexample.github.io/mini> Mini </a><li><a href=https://learnbyexample.github.io/tips> Tips </a><li><a href=https://learnbyexample.github.io/tags> Tags </a><li><a href=https://learnbyexample.github.io/about> About </a></ul></nav></header><main><div class=content id=mobile-panel><article class=post><header class=post__header><h1 class=post__title><a href=https://learnbyexample.github.io/mini/bash-compound-commands-redirection/>Bash compound commands and redirection</a></h1><div class=post__meta><span class=post__time>2022-06-04</span></div></header><div class=post-content><p>I've been using Linux for about 15 years. There are a lot of features I don't know and some that I've used but not often enough or to the full extent of possibilities.<p>Recently, I had written a <code>bash</code> function, which required saving the output of a <code>for</code> loop to a file. I knew that <a href=https://www.gnu.org/software/bash/manual/bash.html#Compound-Commands>compound commands</a> support <a href=https://www.gnu.org/software/bash/manual/bash.html#Redirections>redirection</a>, but it didn't strike me at that time as I haven't had to use them often.<p>Here's a simplified version of the function I wrote first:<pre class=language-bash data-lang=bash style=background-color:#f5f5f5;color:#1f1f1f;><code class=language-bash data-lang=bash><span style=color:#c23f31;>pf</span><span>()
22
</span><span>{
33
</span><span> </span><span style=color:#72ab00;>></span><span> input.txt
44
</span><span> </span><span style=color:#72ab00;>for</span><span> f </span><span style=color:#72ab00;>in </span><span style=color:#d07711;>"$</span><span style=color:#acb3c2;>@</span><span style=color:#d07711;>" </span><span style=color:#72ab00;>; do </span><span style=color:#b39f04;>echo </span><span style=color:#d07711;>"$</span><span style=color:#acb3c2;>f </span><span style=color:#d07711;>$</span><span style=color:#acb3c2;>f</span><span style=color:#d07711;>.bkp" </span><span style=color:#72ab00;>>></span><span> input.txt </span><span style=color:#72ab00;>; done

0 commit comments

Comments
 (0)