<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Emanoel Lopes</title>
    <description>The latest articles on DEV Community by Emanoel Lopes (@emanoelopes).</description>
    <link>https://dev.to/emanoelopes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F863448%2Fbb8837dc-ff68-4591-a743-571285ad2dd5.png</url>
      <title>DEV Community: Emanoel Lopes</title>
      <link>https://dev.to/emanoelopes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emanoelopes"/>
    <language>en</language>
    <item>
      <title>Creating multiples directories from a file on bash terminal</title>
      <dc:creator>Emanoel Lopes</dc:creator>
      <pubDate>Mon, 13 Jun 2022 19:56:25 +0000</pubDate>
      <link>https://dev.to/emanoelopes/creating-multiples-directories-from-a-file-on-bash-terminal-lfb</link>
      <guid>https://dev.to/emanoelopes/creating-multiples-directories-from-a-file-on-bash-terminal-lfb</guid>
      <description>&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;A repetitive task to do: create 111 directories with 2 sub directories each one. The structure is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├── SMD0088
│   ├── files
│   └── tasks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The names are from a spreadsheet column.&lt;/p&gt;

&lt;h2&gt;
  
  
  The motivation
&lt;/h2&gt;

&lt;p&gt;I need to prepare 6 computer labs for next semester classes. Each professor has a small list of application to install on a right lab. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;Create an Ansible role to each subject and a playbook for each lab.&lt;/p&gt;

&lt;h2&gt;
  
  
  The procedure
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Copy and paste the spreadsheet column and save as 'd' file.&lt;/li&gt;
&lt;li&gt;Navigate to 'playbook/roles' ansible directory and run the command:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;$ while read line; do mkdir -p $line/{tasks,files}; done &amp;lt; d&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;p&gt;The line 'SMD0088' on "d" turns on to 'SMD0088/files' and 'SMD0088/tasks' directories.&lt;/p&gt;

</description>
      <category>bash</category>
      <category>ansible</category>
    </item>
  </channel>
</rss>
