I am back with some cools tools from my box of Linux.
We all want that our work should be easy and fun and we always witness that many of the tasks are automated reducing manual efforts. We shall talk about some useful logic/ideas that will enable you ease your daily work in LINUX./UNIX/AIX environment.
1. Use as many aliases as you can
There are several command that we have to enters very very frequently. like going to certain folder, checking some process is running or not listing latest 10 files in a directory etc. so why to enter the entire command again and again?
Being a consultant in DBS project I have witnessed many cased where the shell script that is copied or created may contain some special characters. This happens when the script is copied from windows system to AIX and the script was having extra spaces.
So, if the script is having such speciall characters, it might not get executed successfully throwing error as below:
Command not found: ^M
The solution is we have to find and remove all special characters like these from the script.
Here we shall practice a very simple way to do the same.
DESCRIPTION
Collect and display facts about the current system. The library behind Facter is easy to expand, making Facter an easy way to collect information about a system from within the shell or within Ruby.
OPTIONS puppet: Load the Puppet libraries, thus allowing Facter to load Puppet specific (custom) facts
We very often use the inbuilt variable $? in linux to check the status of last command used.
To find if the last command is correctly executed, we fire echo $? always. If it return 0, the command is successfully completed else some error occured while executing the command.