{"id":55,"date":"2021-11-17T07:03:18","date_gmt":"2021-11-17T07:03:18","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/?p=55"},"modified":"2021-11-17T07:04:25","modified_gmt":"2021-11-17T07:04:25","slug":"bashing-deficiencies-away","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/2021\/11\/17\/bashing-deficiencies-away\/","title":{"rendered":"Bashing Deficiencies Away"},"content":{"rendered":"\n<p>Spending some quality time with the command line<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Confession<\/h2>\n\n\n\n<p>It is embarrassing to admit, but I am one of those Computer Science majors not well versed in shell commands. Navigating  directories, creating files, and compiling\/debugging basic C programs is basically the beginning and end of my knowledge. This is what prompted to take the evening to explore a little more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Practice, Practice<\/h2>\n\n\n\n<p>Thus, I set out to write a few simple scripts. I thought it would be neat to add a couple custom commands to my terminal. The first one prints the definition of a word to console. I accomplished this using by writing a function that accepted the word in question as an argument. The definition was requested from dict.org then that function is aliased using another function so that the argument can be passed to the function. <\/p>\n\n\n\n<p>The second command prints out my IP address to the console. My computer is a laptop, so this is not completely frivolous. The current network configurations are found through <em>ifconfig.<\/em> The results are piped to <em>grep<\/em> which searches for lines containing  &#8220;broadcast&#8221;. Then, this line is piped to <em>awk<\/em> to select the IP address portion and display it. <\/p>\n\n\n\n<p>I noticed that by aliasing those commands that they did not persist into a new terminal window as I intended. My default shell is Z shell, so I appended the commands to the .zshrc file in the root directory. This resource script is run every time a shell is started (or restarted) so persistence was achieved. While that all sounds very basic, it was not without complications. I spent a considerable amount of time trying to figure out how to pass the argument for the dictionary word once it was aliased. I was messing around with string expansion pointlessly until I figured out the function was necessary. To my understanding, the alias arguments were being passed after the <em>curl<\/em> command which is why it only initially returned with a default. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Aspirations <\/h2>\n\n\n\n<p>This little exercise was exciting and a couple hours melted away pleasantly. It reminded me of the fun I had in Introduction to Operating Systems. Feeling reintegrated,  I&#8217;ll have to think of a passion OS project for myself after this quarter. The courses from the program here at Oregon State University have offered a lot of breadth and shown me that I have only seen the tip of the CS iceberg. I enjoy that one project just becomes a stepping stone to the next project. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spending some quality time with the command line Confession It is embarrassing to admit, but I am one of those Computer Science majors not well versed in shell commands. Navigating directories, creating files, and compiling\/debugging basic C programs is basically the beginning and end of my knowledge. This is what prompted to take the evening &hellip; <a href=\"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/2021\/11\/17\/bashing-deficiencies-away\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Bashing Deficiencies Away<\/span><\/a><\/p>\n","protected":false},"author":11551,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-55","post","type-post","status-publish","format-standard","hentry","category-miscellaneous"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/posts\/55","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/users\/11551"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/comments?post=55"}],"version-history":[{"count":3,"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/posts\/55\/revisions"}],"predecessor-version":[{"id":58,"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/posts\/55\/revisions\/58"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/media?parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/categories?post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/dotslashn00b\/wp-json\/wp\/v2\/tags?post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}