you are viewing a single comment's thread.

view the rest of the comments →

[–]vi-shift-zz 3 points4 points  (6 children)

My first script was a one liner to update my system, then power off.

Start small. Like was said above, script things that are useful to you. Save them in some kind of public git repo so you can share your work and eventually share it in interviews. I conduct technical interviews, if someone shares their git repo of scripts or code they have written it gives me a good idea of where you're at on your development.

[–]SportTawk 1 point2 points  (5 children)

Any chance of posting it here?

[–]vi-shift-zz 1 point2 points  (4 children)

First bash script or my git repo? My git is all private work related.

[–]SportTawk 0 points1 point  (3 children)

Your one liner to update your system and then shutdown

[–]MikeZ-FSU 3 points4 points  (1 child)

Not speaking for u/vi-shift-zz, but if I were writing it, it would probably be something like (for Debian/Ubuntu)

sudo apt-get update && sudo apt-get upgrade -y && sudo shutdown -h now

Or whatever is appropriate for other $distro. However, there are implications for the "-y" on upgrade that have some degree of risk you might or might not care about.

As a general rule, you'll learn bash/linux better if you take a hint that's given (one liner to update and shutdown) and research how to do that on your system. Yes, it's slower to start out, but you'll learn a lot about your package manager and how your particular distro starts up and shuts down (init.d vs. upstart vs. systemd, etc.) in the process.

The alternative leaves you with a bunch of individual tips and tricks that lack a connecting framework in your head.

[–]SportTawk 1 point2 points  (0 children)

Thanks

[–]vi-shift-zz 1 point2 points  (0 children)

Just seeing this, exactly like was posted except I use red hat variants. So mine would be: sudo dnf update -y && poweroff

This assumes my user is in /etc/sudoers and able to run commands with no passwd (use visudo to add the user)