Author: Arpit Mandliya
- 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 […]
- 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-67699c1116eb9883269897/] To do as demonstrated above, we can use different ways. Let’s […]
- 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-67699c1117010191651416/] [crayon-67699c1117014700621475/] 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 […]
- 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 […]
- 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-67699c1117209470530437/] [crayon-67699c111720b573003057/] 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 | […]
- 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-67699c11173f2123390889/] [crayon-67699c11173f5790456843/] You must […]
- 14 February
Set Environment Variable in PowerShell
Windows Environmental Variables and Their Scope There are three different scopes for environment variables in Windows. Set the Session Environment Variable Set an Environment Variable for a User Using PowerShell Set the Machine Environment Variable Before moving towards solutions, we must know the environment variables and why we use them. System administrators can access a […]