<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title><![CDATA[Arthur Nunes Blog]]></title>
        <description><![CDATA[This is my blog]]></description>
        <link>http://localhost:3000</link>
        <generator>RSS for Node</generator>
        <lastBuildDate>Wed, 01 Apr 2026 20:36:41 GMT</lastBuildDate>
        <atom:link href="http://localhost:3000/rss.xml" rel="self" type="application/rss+xml"/>
        <language><![CDATA[en]]></language>
        <item>
            <title><![CDATA[First steps with ShellScripting]]></title>
            <description><![CDATA[
As most of you - don't - know, I've been a loyal Linux user for pretty much a year by now and I love it, it helps me stay productive and I've always been an open-source lover.
Also, I have the not-so-healthy habit of formatting my computer almost weekly, with Windows that was a pain, but in Linux I can write a script to do everything I need for me. I do not recommend you to do that to your PC that frequently, but I can't help myself. So, with the goal of saving me some hours every week, I proceeded to write it, in this post I'll explain what I learned in my first week of studying.

PS: I only know JavaScript, and my first experiences with programming were all in JavaScript, so JS will be the referential.

### 1. Spacing and quoting are very important

I was very surprised when I discovered that sometimes spacing in between brackets in conditional statements mattered, and that I had to quote a lot more than expected to make bash read my strings with spaces as one, even though they were declared quoted. Here's an example:

```bash
array=(
  item0
  "item 1"
)

for each in ${array[@]}; do
  echo $each
done
```

Output:

```bash
item0
item
1
```

But, if we change `${array[@]}` to `"${array[@]}"`, the output will be:

```bash
item0
item 1
```

As I would have expected because of my JS baggage.

In JavaScript you can pretty much skip a lot of "code formalities" like that, you can skip semi-colons at the end of operations, you can space practically how you want the parentheses of your if statements and more.
The answer to [this](https://unix.stackexchange.com/questions/117438/why-are-bash-tests-so-picky-about-whitespace) question explains it well enough if you want to read it.
JavaScript's syntax is a lot more flexible than bash's.

### 2. Content disparity

We all know that JavaScript is well-established right now, and that means that there is a lot of content in that language, from tutorials to questions and answers in Stack Overflow.
That, at first, seems like a great thing, and it almost always is, but it wasn't uncommon for me to waste 15+ minutes to find an answer to a simple question(that is also because of the infinity of ways to do things in JavaScript) and it was very frustrating.

In contrast, for bash I found a lot less content, but because of the objectivity of the language, I was able to find answers quicker, I recurrently found what I was looking for in the first or second link that I opened. A great example of this is the page that I linked in the first topic, I found it in less than 5 minutes, even though I was not using very specific terms to google it.

### 3. Conclusion

I had a great time learning to write ShellScript and I feel revigorated after writing different code for a while, sometimes a simple change for a week or two can help you a lot!

#### Thank you for reading!]]></description>
            <link>http://localhost:3000/articles/first-steps-with-shellscripting</link>
            <guid isPermaLink="true">http://localhost:3000/articles/first-steps-with-shellscripting</guid>
            <pubDate>Wed, 26 Aug 2020 00:00:00 GMT</pubDate>
        </item>
    </channel>
</rss>