5 important things to follow to become good in shell scripting

简介: http://unix-school.blogspot.in/2011/07/5-important-things-to-follow-to-become.

http://unix-school.blogspot.in/2011/07/5-important-things-to-follow-to-become.html

Everybody wants solutions to their problems, and more importantly,  we are now expected to get it faster. One can give faster solutions in Unix when one has a good grip on the command line options, and more importantly scripting languages. There are quite a few of them present: Basic Shell scripting, perl scripting, python, ruby, etc. Though our title reads to become good in shell scripting, we in general are going to discuss how to become good in automating things? Or the kind of outlook one needs to have to go in that direction?

    How can one become good in automation? Is it just books one has to read and master or something more? Let us see in this article 5 different traits if one has can turn things around:


1 . Be lazy: The most important trait of all is, to be lazy, to be absolutely lazy. Please don't read between the lines. Being lazy means to show laziness to do the same things repetitively.  The more lazy you are, the more you start disliking tasks of such nature which demand you to grind the same stuff day-in and day-out.  Gradually, you start thinking towards a solution which will get the job done easily, which will achieve the same result with lesser effort which in turn will lead you to automation.  Keep in mind, the world tomorrow is for those who do things better and more importantly, faster.

2. Learn scripting languages: One can give many tips to follow to evince interest in automation, however at the end of the day, it is the individual's choice to show interest in what he or she is doing. We need to be very interested in making things simpler, which makes our life comfortable. Once you start showing interest, you will start doing all the right things such as learning different automation stuffs in UNIX like basic shell scripting, sed, awk, perl, python, ruby,etc. Once you have learnt a scripting language, look out for some potential things or tasks in your project which can be automated. Once you automate something, you will understand the real joy and power behind automation.

3. Pay attention to the smallest of things: An employee's mantra should always be: Make life simple for others.When you are in an organization, you might be in an environment where you will find quite a few things which can be automated. In this case, you have lot of scope for automation. However, it is also possible where you find everything has been automated already in your project, nothing else left or no scope for any more automation. I personally do not accept the fact that there is no scope for automation in any project. The thing you should keep in mind is: Be aware and pay fullest attention to the smallest of things. There are many many things which without realizing we keep doing again and again. Even though it is small, if automated will lead to a considerable time saving. The point I am trying to make is: You need not sit and think what can I automate in my work place. Just pay attention to your day to day activities, you will get hundreds of places where you can automate.

4. Participate in forums: Say, you learnt some scripting language, say shell scripting or perl scripting. If you are working in an environment where you get work on scripting on a regular basis, no issues. However, this may not be the case everywhere or for everybody. Sometimes, you may get a scripting task once in a blue moon, and by the time the next task comes, we have forgotten what we learnt. Due to this, we are in need wherein we need to be continuously in touch with what we have learnt. And the best way to do this is by participating in forums. Everyday, one should spend atleast half-an-hour in a forum. For Unix people, I will always prefer unix.com .

   Participating in forums is not just to remain in touch.  Keep in mind, for every problem, there is more than one way of solving it. The real meaning of this statement you will realize when you participate in any forum. Even for some simplest of problems, you will see most beautiful solutions. And when you see a particular problem being approached in many different ways, your thinking towards a problem starts differing, starts getting multiple options. Also, the kind of learning which will happen here is something which you may not come across in any text book.

5. Develop a never repeating mindset: Tell yourself you will never do the same thing again. If you are doing the same thing again and again,  something is going wrong. Once you develop a mindset of this nature, you will automatically be more inclined towards automation or scripting. Think of ways which will minimize the effort, reduce the time needed to perform it. Any time you get something which you had done before, ask yourself one question: "How can I do it better than last time?". Next time, when you get it again, ask yourself: "What can I do so that I need not repeat the whole thing again next time?"

Happy Automating!!!

 

相关文章
|
Unix Shell Perl
5 important things to follow to become good in shell scripting
http://unix-school.blogspot.in/2011/07/5-important-things-to-follow-to-become.
850 0
|
Unix Shell Perl
5 important things to follow to become good in shell scripting
http://unix-school.blogspot.in/2011/07/5-important-things-to-follow-to-become.
1055 0
|
Unix Shell Go
10 good shell scripting practices
http://unix-school.blogspot.in/2011/07/5-important-things-to-follow-to-become.
897 0
|
2月前
|
Shell
一个用于添加/删除定时任务的shell脚本
一个用于添加/删除定时任务的shell脚本
106 1
|
1月前
|
Shell Linux 测试技术
6种方法打造出色的Shell脚本
6种方法打造出色的Shell脚本
59 2
6种方法打造出色的Shell脚本
|
23天前
|
XML JSON 监控
Shell脚本要点和难点以及具体应用和优缺点介绍
Shell脚本在系统管理和自动化任务中扮演着重要角色。尽管存在调试困难、可读性差等问题,但其简洁高效、易于学习和强大的功能使其在许多场景中不可或缺。通过掌握Shell脚本的基本语法、常用命令和函数,并了解其优缺点,开发者可以编写出高效的脚本来完成各种任务,提高工作效率。希望本文能为您在Shell脚本编写和应用中提供有价值的参考和指导。
50 1
|
28天前
|
Ubuntu Shell 开发工具
ubuntu/debian shell 脚本自动配置 gitea git 仓库
这是一个自动配置 Gitea Git 仓库的 Shell 脚本,支持 Ubuntu 20+ 和 Debian 12+ 系统。脚本会创建必要的目录、下载并安装 Gitea,创建 Gitea 用户和服务,确保 Gitea 在系统启动时自动运行。用户可以选择从官方或小绿叶技术博客下载安装包。
45 2
|
2月前
|
监控 网络协议 Shell
ip和ip网段攻击拦截系统-绿叶结界防火墙系统shell脚本
这是一个名为“小绿叶技术博客扫段攻击拦截系统”的Bash脚本,用于监控和拦截TCP攻击。通过抓取网络数据包监控可疑IP,并利用iptables和firewalld防火墙规则对这些IP进行拦截。同时,该系统能够查询数据库中的白名单,确保合法IP不受影响。此外,它还具备日志记录功能,以便于后续分析和审计。
51 6