How to Write a Shell Script: Linux Terminal 201 - HakTip 175

preview_player
Показать описание
Hak5 -- Cyber Security Education, Inspiration, News & Community since 2005:
____________________________________________
In today's HakTip, Shannon covers writing and executing shell scripts in the terminal.

This HakTip is sponsored by Moogsoft.

-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆

Editor: Perrin M
-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆-----☆
____________________________________________
Founded in 2005, Hak5's mission is to advance the InfoSec industry. We do this through our award winning educational podcasts, leading pentest gear, and inclusive community – where all hackers belong.
Рекомендации по теме
Комментарии
Автор

Want to thank you Shannon and Hak5 for producing these Haktips. I have been following along and with other books I have been getting more and more comfortable using the terminal. Each episod builds on the last and you make it clear and easy to follow.

KSMcLeod
Автор

Old guy time. (a) "#!" didn't exist before around 1980. It actually has to be baked into the kernel itself, and finding a way to do that securely was difficult. The kernel actually checks the first two characters of a file it's asked to execute. (b) "#" is used because it's a comment character in most shell languages, so that the script interpreter (bash or whatever) ignores the shebang line. (c) Any fully-pathed executable can follow the shebang: /usr/bin/perl, /usr/bin/python, etc. Very popular is "env", as in "#!/usr/bin/env python": this will execute the script with whatever version of "python" is first in the user's PATH environment variable. Use with caution. (d) Google "perlrun" or "running_under_some_shell" for a stupid Perl trick to make "#!" work (at least for Perl) on the few Unix-like systems that don't implement it. (e) Until you really know what you're doing, do NOT set the set-UID or set-GID flags on shell scripts!

banas
Автор

Nice video and I hope to do advanced things in next haktip episodes

ahmedhlilioune
Автор

Thank you Shannon! You are a beautiful human.

DJMontePGH
Автор

your videos make me love terminal more

farahmohumad
Автор

im to busy looking at her microphone..

mica
Автор

I'm taking a Cisco Linux class at NSCC, I have gotten more information from these linux videos than the class that I'm paying for. Thank you all so much for the information. I will be getting my Linux certification because of your videos not that class....

infobahnpirate
Автор

Also remember its in unix type filetype and not windows as it wont work, but on linux unit / linux is default anyways so just letting you all know in case it dont work that might be why! Also i really prefer using .sh extension so i can use wildcards like chmod +x *.sh that does it on all .sh files only! why would you have a .sh that isnt executable is my thinking!

JNET_Reloaded
Автор

Thanks can you do more advanced stuff. Would love to see a how to make a Linux kiosk

cunninghamb
Автор

What is the extension for .elf? She is wrong to assume that's it bash. Also, is it not common to use .sh for bash?

toaster
Автор

Can you please teach complete shell scripting. I really like the way you teach.

purushothamsharma
Автор

Minor gripe, but the '#' is not a hash tag.

teslafreak
Автор

I don't have anything against white backgrounds (heck I use them myself) but it's pretty silly to be using such a layout when the OS is using a dark theme.

MsHojat
Автор

Nice introduction. But please use symbols and not octal numbers to change file rights. So instead of that octal number you used, use this.


chmod +x heyworld # Set the file to a program.

AndersJackson
Автор

What do u think about linux new code of conduct and how u gonna code with shell when all the devs taking heat from social politics pull there code off the kernel.

trufulnuffsaid
Автор

iEYE heard the Ocean . . . tips. . . . and saw the Pearl of GrEat PRiCE Hidden DEEP iNsidE!

TheElijahMinistries
Автор

sudo apt-get update && apt-get upgrade -y

DAVIDGREGORYKERR
Автор

Wahahahahahahahaha!
Am very proud of u

fixerdeyz
Автор

I think I am in love with that woman :):)

charlesbrasil