Skip to content

Gaurav Kuwar

  • Home
  • Categories
    • Notes
    • Linux
    • Python
    • Android
  • Certifications
  • About me

Tag Archives: script

Good Shell Scripting Practices

Just some notes on good practices when shell scripting… It is a good idea to comment your code (this is for programming in general). Have a header with name of script, author, modification date and parameters being used. Variable declaration comments should be on the same line. While other comments can be on a separateContinue reading “Good Shell Scripting Practices”

Multiple Copies (cp) of a File with Bash

The syntax of the script will be: ./mcp main_file copy1 copy2 copy3 … ./mcp is the script name, main_file is the file that will be copied and copy1, copy2, copy3 and so on are the copies of main_file. I started the script off by getting the main_file in $1 and with shift separating it from the copies: #!/bin/bash file=$1 shift My secondContinue reading “Multiple Copies (cp) of a File with Bash”

Gaurav Kuwar, Proudly powered by WordPress.