Mindblown: a blog about philosophy.

  • Troubleshooting a shell script

    There is one more way other than script execution to run a script in a different shell. Type bash with the name of the script as parameter. Syntax: Example: bash exm Look at the above snapshot, it displays the exm script content with bash command. Look at the above snapshot, this is the exm script we have…

  • Shell Scripting Sourcing a file

    A file is sourced in two ways. One is either writting as source <fileName> or other is writting as . ./<filename> in the command line. When a file is sourced, the code lines are executed as if they were printed on the command line. The difference between sourcing and executing a script is that, while executing a script…

  • Shell Scripting Variables

    Scripts can contain variables inside the script. Look at the above snapshot, two variables are assigned to the script $var1 and $var2. As scripts run in their own shell, hence variables do not survive the end of the script. Look at the above snapshot, var1 and var2 do not run outside the script.

  • Shell Scripting Comments

    Any line starting with a hash (#) becomes comment. Comment means, that line will not take part in script execution. It will not show up in the output. Look at the above snapshot, lines after the # are commented. Look at the above snapshot, commented lines are not displayed in the output.

  • Shell Scripting She-bang

    The sign #! is called she-bang and is written at top of the script. It passes instruction to program /bin/sh. To run your script in a certain shell (shell should be supported by your system), start your script with #! followed by the shell name. Example:

  • How to determine Shell

    You can get the name of your shell prompt, with following command : Syntax: Look at the above snapshot, with the help of above command we got the name of our shell which is ‘bash’. The $ sign stands for a shell variable, echo will return the text whatever you typed in.

  • What is Shell Scripting

    In Linux, shells like bash and korn support programming construct which are saved as scripts. These scripts become shell commands and hence many Linux commands are script. A system administrator should have a little knowledge about scripting to understand how their servers and applications are started, upgraded, maintained or removed and to understand how a…

  • Shell Scripting Tutorial

    Shell Scripting tutorial provides basic and advanced concepts of Shell Scripting. Our Shell Scripting tutorial is designed for beginners and professionals. Shell Scripting is an open-source operating system. Our Shell Scripting tutorial includes all topics of Scripting executing scripting, loops, scripting parameters, shift through parameters, sourcing, getopts, case, eval, let etc. There is also given…

  • UFormat

    The UFormat parameters allow us to mention a format that we want to display in Unix format. The syntax of this format command is as follows Get-Date -UFormat %\<value\>. The cmdlet -UFormat always returns an output as a String value. Below are various specifiers list and their descriptions that are used with -UFormat parameters provided by Microsoft. List of UFormat…

  • Format

    Using the -Format parameter in the PowerShell command, you can display date and time in a specific format that you specify. The -Format parameter accepts all values which are allowed in the Microsoft .Net framework and included in the DateTimeFormatInfo Class. There are different format options available that you can use to format your date and time results…

Got any book recommendations?