Giter Club home page Giter Club logo

just_shell's Introduction

just_shell

Shell Basics

This Repository is meant for learning and documenting Shell Lessons just like in Just Python

Introduction

How to start writing a bash script?

  1. Create a bash file using standard linux editor vi.
  2. Execute the following commands to open a file namely vi start_with_bash.bash.
  3. Start with #!/usr/bin/bash as the first line. The significane of having this line as the first line tells the OS to invoke the specified shell to execute the commands that follow in the script. #! is often referred to as a "hash-bang", "she-bang" or "sha-bang".
  4. Add a few lines as below.
  5. Exit after saving using :wq. Change the script execution permissions using the command chmod u+x start_with_bash.bash.
  6. Execute the script using the command ./start_with_bash.bash
#!/usr/bin/bash 

echo "Printing the script."

Keywords used in Linux Shell/Bash Script:

The following are the keywords which cannot be used for declaring variables.

  1. read
  2. echo
  3. readonly
  4. set
  5. unset
  6. shift
  7. export
  8. if
  9. then
  10. else
  11. fi
  12. elif
  13. case
  14. esac
  15. break
  16. continue
  17. while
  18. until
  19. for
  20. select
  21. do
  22. done
  23. eval
  24. trap
  25. test
  26. exec
  27. sleep
  28. wait
  29. return
  30. exit

Comments in Shell Script

Using # for Comments

	#!/usr/bin/bash 
	echo "A comment will follow after this line" # Here is the comment
	echo "A # here does not begin a comment" 
	echo A \# here does not begin a comment 
	echo The # here begins a comment 

As in the above scripts, anything after # is depricated. See the output on executing the above script.

A comment will follow after this line
A # here does not begin a comment
A # here does not begin a comment
The

Resources

All relevant resources are available here: resources

just_shell's People

Contributors

sharmasourab93 avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.