How to write a bash script

Поділитися
Вставка
  • Опубліковано 12 вер 2024

КОМЕНТАРІ • 130

  • @thiagosilvafarias
    @thiagosilvafarias 4 роки тому +44

    Thank you very much, very clear tutorial. Just a tip to those who got stuck on "less" command. Press "q" or "ZZ" to exit.

  • @khr1395
    @khr1395 5 років тому +30

    This was extremely helpful in helping me get started on a school assignment, thank you so much

  • @Joe-gh8pg
    @Joe-gh8pg 4 роки тому +2

    I took an hour course before this and was lost. You explained it in 8 minutes! Thanks!

  • @ozzieboy007
    @ozzieboy007 4 роки тому +1

    Thanks Maria. Your tutorials are absolutely brilliant! You really explain clearly and thoroughly. I would have to say that yours are the BEST tutorials I've ever seen. Your voice is very pleasant to listen to as you explain what you are typing. I so look forward to your videos. Cheers.

    • @OMGenomics
      @OMGenomics  4 роки тому

      Thank you, that's so nice to hear!

  • @brendannolan2508
    @brendannolan2508 5 років тому +4

    Super clear and to-the-point. Thanks!

  • @saikumark1224
    @saikumark1224 3 роки тому +1

    Thank u so much Maria! This video helped me put my front foot in the world of Bash Scripting and move further!!!!!

  • @fatllamalord
    @fatllamalord 3 роки тому +1

    This is a great tutorial! I learned more from this than I did from my professor!

  • @ashararfeen9389
    @ashararfeen9389 4 роки тому +2

    Thanks a lot. This helped me complete my assignment. I really appreciate you. Keep rocking and educating us.

  • @chenmoasis
    @chenmoasis 10 місяців тому

    Thank you for this great helpful video!

  • @richlovin2173
    @richlovin2173 4 роки тому

    Well done. Clear and easy to follow,. Keep contributing.

  • @lloydy272
    @lloydy272 7 років тому +1

    Very helpful video. I have started to do more in bash and less in Python recently but variable inputs is something I have not read up on yet, and now I don't need to thanks to this! Saving me some horrid hard-coded shell scripts!

    • @OMGenomics
      @OMGenomics  7 років тому +1

      That's lucky! Since you are using both Python and bash, you might also like the latest video about turning your python scripts into command-line programs: ua-cam.com/video/zi-FIG3efag/v-deo.html

    • @lloydy272
      @lloydy272 7 років тому

      OMGenomics Yes I use this approach but passed it on to my Undergrad so that they can learn. Thanks for making these

  • @webdeveloperninja9220
    @webdeveloperninja9220 4 роки тому +1

    Thank you so much, windows guy new to the whole linux thing

  • @kenepperson904
    @kenepperson904 2 роки тому

    Thank you for the video. It was really helpful and easy to understand. Looking forward to your videos.

  • @aaronwilson9261
    @aaronwilson9261 6 років тому +1

    thanks for the video. It's very helpful cos I can't make sense of things on paper and you gave a great example to get started with.

  • @BlueOnyx1206
    @BlueOnyx1206 4 роки тому

    greatly appreciate the tutorial, really needed help running some DNA libraries quickly

  • @saveplanet3977
    @saveplanet3977 4 роки тому +1

    Very precise and neat 🙏

  • @facileprinceps4687
    @facileprinceps4687 Рік тому

    Great video! , verry helpful (:

  • @mordedordelapis
    @mordedordelapis 3 роки тому +1

    Saved my life! Thanks!

  • @__ShafiqaIqbal__
    @__ShafiqaIqbal__ 4 роки тому +3

    You're amazing

  • @rajcodes100
    @rajcodes100 4 роки тому

    Good job - explanation was clear .

  • @Myrkailln
    @Myrkailln 4 роки тому

    Tusen takk, mitt første bash-script :)

  • @regulus8518
    @regulus8518 5 років тому +2

    straight forward and to the point ... thank you

  • @jayxcodes
    @jayxcodes Рік тому

    Thank you very much this helped alot

  • @mohamedyahia9278
    @mohamedyahia9278 4 роки тому +2

    it is very nice, and helpful, this help me start. Good luck

  • @daveycrockett9447
    @daveycrockett9447 5 років тому +1

    Great Tutorial- very well explanted.

  • @Komplexitet
    @Komplexitet 5 років тому +1

    Perfect. This got me started.

  • @hanemellethy9036
    @hanemellethy9036 4 роки тому

    thanks for the video and the information. it is really helpful and understandable. it was my first time to create a bash file :)

  • @nesuleo1779
    @nesuleo1779 4 роки тому

    You should replace our professor. Man! he throws things on us and makes us search all of the world. You have explained this in no time. I will make sure telling him that.

  • @devdee7285
    @devdee7285 2 роки тому

    This is it. Thank you.

  • @SeqBioMusic
    @SeqBioMusic 7 років тому +2

    Hi Maria,
    It seemed that you use Python, Perl, R and Bash in your work. Is it possible you can talk about how you choose a language when you're trying to solve a problem?
    Best,
    Shaojun

    • @OMGenomics
      @OMGenomics  7 років тому +2

      Choosing a programming language was the topic of the first episode: ua-cam.com/video/ZZz9HROAONA/v-deo.html

  • @djs1258
    @djs1258 6 років тому +3

    Totally made me worth watching... Good one.

  • @Raven-nf6nc
    @Raven-nf6nc 3 роки тому

    awesome video! very helpful

  • @davejackson88
    @davejackson88 Рік тому

    great job ma'am

  • @julianzuloaga
    @julianzuloaga 3 роки тому

    thanks Maria, you rock!

  • @sonnix31
    @sonnix31 5 років тому

    Nice and simple. Thanks.

  • @josemfacuna6754
    @josemfacuna6754 4 роки тому

    Maria! where are you? Your videos about Bash ware great. Nee more, please... Thank you.

  • @astronautis1674
    @astronautis1674 4 роки тому

    Thank you that was very useful

  • @kylem8127
    @kylem8127 4 роки тому +1

    What key is pressed after she looks at myscript, in order to return to the previous page @ 2:45?

    • @OMGenomics
      @OMGenomics  4 роки тому +2

      q is how you get out of the less program.

  • @plaguegenocide4943
    @plaguegenocide4943 2 роки тому

    after "less myscript" I did go to the Hello file thingy, how do I get back to the terminal? where I can type again?

  • @marioparada1424
    @marioparada1424 6 років тому

    Quick question, I am fairly new to shell scripting,
    I am creating a start up script for my oracle DB.
    Once I have loged in to SQLPlus, I prompt user to input password.
    Once the password is given, I connect to SQLPlus, but the script does not run anymore, so I am left on SQLPlus, waiting for me to execute SQL commands.
    I have written the commands I want the script to write, but I am unable to do so.
    #!/bin/bash
    sqlplus sys as sysdba
    stty -echo
    read -p "Password: " pass
    stty echo
    printf '
    '
    sqlplus -S system/manager

  • @jumanjiwarlord
    @jumanjiwarlord 3 роки тому

    i wrote a couple scripts and didn't use #! and they worked fine. whats the deal. is it even necessary?

  • @Jonpaulim
    @Jonpaulim 3 роки тому

    Hi great video thanks. Can I ask a question please

  • @maheshm8770
    @maheshm8770 3 роки тому

    Thanks, maria!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @thejakumar4489
    @thejakumar4489 2 роки тому

    Thank you 💐

  • @ian7485
    @ian7485 6 років тому +1

    What a helpful video. Thanks a lot! Nice to see more women in STEM.

  • @pedrofernandosalgadoalvare772
    @pedrofernandosalgadoalvare772 3 роки тому

    Thanks, Maria!

  • @pathtopixels
    @pathtopixels 3 роки тому

    Perfect, thank u

  • @Gheedren
    @Gheedren 3 роки тому

    good video, helpful for arch linux noob

  • @anawar8124
    @anawar8124 5 років тому

    Thank you so much Maria

  • @ladymurrieta645
    @ladymurrieta645 3 роки тому

    Thaaaaanks 👩‍💻🌟

  • @johnredorn
    @johnredorn 4 роки тому

    Thank you for the video

  • @IAfoke
    @IAfoke 3 роки тому

    Legend

  • @loitruong146
    @loitruong146 2 роки тому

    Hi, Maria. I followed along and it showed "bad interpreter" after i hit enter to excute. Please help. Thanks!

    • @loitruong146
      @loitruong146 2 роки тому

      Hi. I can't use "./" for some reasons; but I used "bash" and it ran. I'm new at this. Your video saved me 3 pages of reading. Thanks.
      May the Universe give you back 10 folds.

  • @utyaffia3708
    @utyaffia3708 4 роки тому

    Hey Maria I have a question. Do you think it’s possible that a person can write a 60 line script?

    • @OMGenomics
      @OMGenomics  4 роки тому

      Of course! This one was just a small example. You can write scripts as long as you need!

  • @mosiotv
    @mosiotv 6 років тому +1

    Great 👍🏻

  • @QuizmasterLaw
    @QuizmasterLaw 3 роки тому

    Mostly I used AWK and SED for text processing, sometimes writing them as scripts. I don't think there are any gui tools for AWK SED or BASH right?

    • @OMGenomics
      @OMGenomics  3 роки тому +1

      Hmm, I don't know of any GUI tools for these, but I would probably prefer to use them on the command-line anyway.

    • @QuizmasterLaw
      @QuizmasterLaw 3 роки тому

      @@OMGenomics A gui for GREP might also be good lol.
      basically i'm lazy and want a frontend lol.

    • @QuizmasterLaw
      @QuizmasterLaw 3 роки тому

      @@OMGenomics currently trying to figur out how to install anbox halium on some flavor of ubuntu btw might be a good topci for a video?

  • @cristianfalco3792
    @cristianfalco3792 7 місяців тому

    thanks for the videoooo

  • @charlesklein7232
    @charlesklein7232 4 роки тому

    HOW DID YOU LEARN THIS? your printing could be bigger im using a 65 inch but for people on a laptop it might be hard.

    • @OMGenomics
      @OMGenomics  4 роки тому +1

      :) I learned this by googling and looking at other people's code on github until I found something that worked and made sense to me.

    • @hereb4theend
      @hereb4theend 3 роки тому

      @@OMGenomics What he meant was that what you are showing in your video is too small in size for anyone other than those with large monitors to learn from it. He wasn't questioning how you obtain knowledge.

  • @bubblesgrappling736
    @bubblesgrappling736 4 роки тому +1

    when I open the script with "less 'filename'" how do i exit that again?

  • @Devil-mz9hb
    @Devil-mz9hb 3 роки тому

    You didn't teach me how to do the command to actually get started with bash scripting.

  • @sadanavenki1059
    @sadanavenki1059 3 роки тому

    thnk you maria

  • @mohamedesmailelsalahaty6050
    @mohamedesmailelsalahaty6050 2 роки тому

    Thanks alot

  • @bumbudo
    @bumbudo 5 років тому

    Thanks for that!

  • @TF12191
    @TF12191 4 роки тому

    Ah nice one, this makes annoying people on my network a lot easier :) loop loop :D

  • @explosivejoe3000
    @explosivejoe3000 3 роки тому

    thanks!

  • @AgrimITEducation
    @AgrimITEducation 6 років тому

    very nice video...

  • @vicyoslinuxofficial2607
    @vicyoslinuxofficial2607 3 роки тому

    That's nice to have a girl making videos related to this topic because it's very rare to find girls recording types of videos.
    Awesome video, btw!!!!! :)

  • @jeeves251
    @jeeves251 4 роки тому

    Thank you

  • @LinuxLuddite
    @LinuxLuddite 5 років тому +1

    that 'thing' after the hash is called bang. And from these two comes the term shebang .

  • @varinderpatwal
    @varinderpatwal 5 років тому

    It's too good...

  • @rajasekhar9610
    @rajasekhar9610 6 років тому

    Hi...do we need to use .sh extension on every script or not

    • @OMGenomics
      @OMGenomics  6 років тому +1

      No, you don't have to use the .sh extension. It's the "shebang" line at the top of the file that makes the script execute using bash.

  • @polymerized8183
    @polymerized8183 3 роки тому

    you're so cool

  • @jonyjohan8958
    @jonyjohan8958 4 роки тому

    how can i make it change directory ?

  • @j99mac
    @j99mac 4 роки тому

    Hi this was a good video. When I fallow along with the script I get the error "line 3: 1: Error: no name given" and not the ability to put my input. I a using this on a mac

    • @OMGenomics
      @OMGenomics  4 роки тому

      Are you following along where I show how that happens when there's no input, and then it works when I put `./myscript Tom`? Or does that still not work for you?

  • @judechiaha5923
    @judechiaha5923 4 роки тому

    Can a (.txt) file run inside a (.sh) file? I have a file which is (.txt), I would want to know if the messages in the (.txt) file can run in the (.sh)file.

    • @phudgestuff
      @phudgestuff 3 роки тому

      Try putting: cat (filename).txt
      But that is only a guess

  • @hiramcoriarodriguez1252
    @hiramcoriarodriguez1252 7 років тому

    Hi, i like your video. Would you mind make a video dealing with FASTA texts?
    I excuse for my english, it´s not my first language.

    • @OMGenomics
      @OMGenomics  7 років тому

      Sure, what do you want to know about FASTA files? There is a tiny description of FASTA files in this blog post: omgenomics.com/python-command-line-program/
      but I can definitely go into more depth. Just let me know what specific questions you have. Thanks!

  • @KSPAtlas
    @KSPAtlas 3 роки тому

    It says nano command not found

    • @OMGenomics
      @OMGenomics  3 роки тому

      You can instead use any other text editor you have available. Nano is just one I found easy enough to use as a beginner, and it was available on all systems I have worked with.

  • @mistikmantar
    @mistikmantar 5 років тому

    cannot focus on

  • @radar536
    @radar536 4 роки тому +1

    Nice to see girls in places that where almost exclusive for men. Gogirl. Thx for the explanation.

  • @Avrahamfalandoserio
    @Avrahamfalandoserio 5 років тому

    F
    Good tutorial

  • @terryacer4847
    @terryacer4847 5 років тому

    You¨re swedish arent ya?

    • @OMGenomics
      @OMGenomics  5 років тому

      Nope, but I was born in Denmark.

    • @terryacer4847
      @terryacer4847 5 років тому

      @@OMGenomics My apologies then. You sure sounded like a swede there for a moment. Anyway thanks for the video. It was certainly of help.

  • @swimmingshi
    @swimmingshi 3 роки тому

    #!usr/bin/env bash
    echo "Subscirbed!"

  • @rmelotto
    @rmelotto 4 роки тому

    Thank you for your tutorial.
    I just think its a bit over complicated for newcomers with error handling and default variables.
    But its interesting anyway.

  • @holahola6860
    @holahola6860 3 роки тому

    Use EMACS or VIM nano is kinda garbage

    • @OMGenomics
      @OMGenomics  3 роки тому

      Yea it's just the only one I could explain to beginners how to use in 10 seconds. I use vim or VScode -- actually I'm at Google so I mostly use our special internal IDE, which I quite like too.

    • @holahola6860
      @holahola6860 3 роки тому +1

      @@OMGenomics oh well my bad 😂 srry I Didn’t know but thanks for your videos they have helped me a lot

  • @PraexorVS
    @PraexorVS 4 роки тому

    zoom it

  • @hdcomputerkeith
    @hdcomputerkeith Рік тому

    xooxoxooxoxo

  • @altugerdem5
    @altugerdem5 5 років тому

    weird flex but ok

  • @tugbaakan7099
    @tugbaakan7099 6 років тому +14

    It should be 'Hello world', not 'Hello!'

    • @OMGenomics
      @OMGenomics  6 років тому +30

      It's whatever I say it is ;)

    • @leszek2499
      @leszek2499 6 років тому +1

      This is the nature of program - programmer relationship. Ofc if it's "well maintained relationship". Sometimes programmer doesn't control what he/she should - the program.

    • @SajidLatifDK
      @SajidLatifDK 6 років тому +1

      So what... the lesson was great, with or without WORLD

    • @varinderpatwal
      @varinderpatwal 5 років тому

      It does not matter it is hello only or hello world. Video is more and best understanding. Thanks beautiful.

    • @jordanbicanic9343
      @jordanbicanic9343 5 років тому +2

      I don't think they got it :D

  • @echillin214
    @echillin214 2 роки тому

    You helped so much thank you