Bash Scripting

Bash Scripting

Hello Everyone, Today we will study about basics of Bash Scripting.

Bash Scripting  is a simple text file which contains series of commands.The scripting files ends with the .sh extension . it must be given execute permission before using it.there are the combination of different commands that we use in the terminal like (mkdir , cp , ls ).this is a UNIX command language which was written by brian fox.this was first introduced in year 1989.Since the bash commands are also available in window also but its more popular in Linux systems.It is also called as  Bourne-Again Shell, Bash is an sh-compatible command language interpreter that executes.

Commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and cash).  these are basically used for easy management of different day to day task executions. a user can create any shortcuts to run any process or can easily handle any service in their respective manner .lets under stand how to create a simple scripts in linux. Now here we will learn to create a simple script that is used to display time in the terminal. Lets check it down below how  here we can use any text editor like here i will be using nano editor

Open Terminal in ubuntu by pressing ctlr+alt+t and then bash scripting

for displaying the date on the terminal we must know the path of the terminal window which can be checked

by typing tty in the root mode and here we get /dev/pts/7

after this

bash scripting

 

Here type nano (scriptname).sh i have used date.sh . the extension must be .sh otherwise it wont be accessible and then adding the commands

bash scripting

 

after entering the commands lets close it by  pressing ctrl+O and enter and after that ctrl+x to exit

than we have to give the execute permission  to the file by entering

bash scripting

now executing by using ./(script name) in our case its ./date.sh and lets see the result

and the result is

bash scripting

 

 

 

66 thoughts on “Bash Scripting

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Today, I went to the beachfront with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!

  2. An fascinating dialogue is price comment. I believe that you should write extra on this matter, it might not be a taboo subject but usually individuals are not sufficient to talk on such topics. To the next. Cheers

  3. I have to thank you for the efforts you’ve put in writing this blog.
    I am hoping to view the same high-grade blog posts by you in the
    future as well. In fact, your creative writing abilities has inspired me to get my own website now 😉

  4. Hello! I know this is somewhat off topic but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one? Thanks a lot!

  5. Hi would you mind letting me know which web host you’re utilizing?
    I’ve loaded your blog in 3 completely different web browsers and I must say this blog loads
    a lot faster then most. Can you recommend
    a good internet hosting provider at a reasonable price?
    Thanks, I appreciate it!

  6. Thanks , I have just been looking for info approximately this subject for a long time and yours is the best I have discovered so far. But, what concerning the conclusion? Are you positive in regards to the supply?

  7. I have been surfing on-line greater than three hours these days, but I by no means found any interesting article like yours. It¡¦s beautiful value enough for me. In my opinion, if all web owners and bloggers made just right content as you probably did, the net will probably be much more helpful than ever before.

  8. It is perfect time to make some plans for the future and it’s time to be happy. I have read this post and if I could I desire to suggest you few interesting things or tips. Maybe you can write next articles referring to this article. I want to read even more things about it!

  9. Wow that was odd. I just wrote an extremely long comment but after I clicked submit my comment didn’t appear. Grrrr… well I’m not writing all that over again. Anyhow, just wanted to say great blog!

  10. I just want to tell you that I’m all new to blogging and definitely liked this website. Very likely I’m want to bookmark your blog . You actually have tremendous article content. Appreciate it for sharing with us your blog site.

  11. I like the valuable information you provide on your articles. I’ll bookmark your weblog and test once more here regularly. I am moderately sure I’ll be informed lots of new stuff proper here! Best of luck for the next!

  12. I was wondering if you ever thought of changing the structure of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or 2 pictures. Maybe you could space it out better?

  13. I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Fantastic work!

  14. This is really interesting, You are a very skilled blogger. I have joined your rss feed and look forward to seeking more of your great post. Also, I have shared your website in my social networks!

  15. With every thing which appears to be building throughout this specific area, many of your perspectives are generally relatively exciting. Having said that, I am sorry, but I can not give credence to your whole theory, all be it exhilarating none the less. It would seem to me that your comments are generally not totally rationalized and in actuality you are generally yourself not even thoroughly certain of the argument. In any event I did enjoy examining it.

  16. Have you ever considered publishing an e-book or guest authoring on other sites?
    I have a blog based upon on the same topics you discuss and would love to have you
    share some stories/information. I know my readers would enjoy your work.
    If you’re even remotely interested, feel free to send me an e mail.

  17. You are so interesting! I do not believe I’ve truly read through a single thing like that before.
    So nice to discover someone with genuine thoughts on this issue.

    Seriously.. thank you for starting this up. This site is one thing that’s needed on the internet, someone with a little originality!

  18. I have been surfing on-line more than 3 hours nowadays, yet I never found any fascinating article like yours. It is lovely price sufficient for me. In my view, if all web owners and bloggers made just right content material as you probably did, the net can be much more useful than ever before.

  19. My spouse and I stumbled over here by a different website and thought I may as well check things out. I like what I see so now i’m following you. Look forward to looking into your web page repeatedly.

  20. Thanks for every other informative web site. The place else could I am getting that type of information written in such a perfect means? I’ve a venture that I’m simply now operating on, and I’ve been on the look out for such information.

  21. Hello there! I know this is kinda off topic however , I’d figured I’d ask. Would you be interested in exchanging links or maybe guest authoring a blog post or vice-versa? My website addresses a lot of the same subjects as yours and I believe we could greatly benefit from each other. If you happen to be interested feel free to send me an email. I look forward to hearing from you! Great blog by the way!

  22. Thanks for a marvelous posting! I genuinely enjoyed reading it, you happen to be a great author. I will remember to bookmark your blog and will often come back at some point. I want to encourage that you continue your great posts, have a nice weekend!

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.