• Check if Variable is empty in Bash
    28 February

    Check If Variable Is Empty in Bash

    Checking If Variable Is Empty in Bash There are multiple ways to check if a variable is empty or not. Before moving towards those methods, knowing when a variable is called empty is necessary. In Bash, a variable is called empty if: A variable is declared without assigning any value to it. A variable is […]

  • Convert List to Integer in Python
    28 February

    Convert List to Integer in Python

    Using for Loop To convert the entire list into one integer in Python: Create a list having integer-type elements. Declare and initialize a variable with 0; it will be used to hold the final integer value. Use the for loop to iterate over the list items. In each iteration: multiply the variable created in the […]

  • Print Blank Line in PowerShell
    20 February

    Print Blank Line in PowerShell

    Print Blank Line in PowerShell We have two string-type messages that we want to print on the PowerShell console, but in between, we also want to have a blank line to increase the readability. For instance, we want to get results as follows: [crayon-68bb2db1361a6110058722/] To do as demonstrated above, we can use different ways. Let’s […]

  • Get first n elements of lists in Python
    20 February

    Get First n Elements of List in Python

    Using List slicing Use list slicing to get first n elements of List in Python. Here’s an example: [crayon-68bb2db136536329327972/] [crayon-68bb2db13653d590467184/] In the above example, list slicing is used to get a list’s first n elements. As we can see, a list was defined as my_list with 6 elements [10, 20, 30, 40, 50, 60]. And […]

  • Echo $1 Bash
    19 February

    What is echo $1 in Bash

    Meaning of the echo $1 in Bash The echo $1 is a bash command; now, those new to Bash can think of it as a famous shell and scripting language in Unix-based operating systems. Using Bash, we can take advantage of multiple features and commands that assist users in automation and system administration tasks. Are […]

  • Remove newline from String in Bash
    19 February

    Remove Newline from String in Bash

    Using tr Command Use the tr command to remove the new line from a string. The tr command is used for character translation or deletion. [crayon-68bb2db136b18562260528/] [crayon-68bb2db136b1d720090405/] In the above, we have a string that contains a newline character between Hello and World. The echo command displays the string, including the newline character. The | […]

  • Bash - For loop 1 to 10
    16 February

    Bash for Loop 1 to 10

    Using for Loop with seq Command To loop from 1 to 10 in the Bash shell: Use the for keyword to start the for loop. Use i as a loop variable, which is accountable for taking values from 1 to 10. Use the $(seq 1 10) expression, which is a command substitution executing the seq […]

  • 16 February

    Privacy Policy

    What information do we collect? On this website, you are required to : enter your email address to get the latest updates from this blog directly into your email box for free enter your name, email, and the website you own, when you put a comment on any post Apart from this, you are not […]

  • 14 February

    How to Run ps1 File from PowerShell

    Running from PowerShell Command-Line To run a PowerShell script(.ps1 file) from a PowerShell command line: Launch the PowerShell as an Administrator and wait for the PS> prompt to appear. Navigate to the directory having your PowerShell script file. Type .\ followed by the ScriptFileName.ps1 and hit Enter to execute the script. [crayon-68bb2db13721f936929216/] [crayon-68bb2db137225408987154/] You must […]