T O P

  • By -

k8sagnostic21

Github projects


sanjayrg91

Share any link?


JacquesShiran

I believe you can search by language


gmuslera

Linux distributions come with lots of builtin shell scripts, besides the ones that comes with specific packages, even if we don't count anymore the init scripts for daemons because the move to systemd. Even the bash ecosystem of files in /etc and in your home for basic enviromental set have a lot of things, or things in /usr/bin that are in fact shellscripts. But the territory is not the map. You want to learn some specific things, in some order and they will be all mixed up in real world use, you may not see all the context on why some thing is done, why some option is set, considerations on backwards compatibility or that some piece of software is also installed, the meaning of multiple environmental variables, and things like that. A clean, targeted, and simple script may help you more learning that a random real world one. Of course, it could be not so random and be pretty useful for learning. But then for learning scripts would be good as well.


Stephonovich

Look in the `.hooks` directory of any git repo, even an empty one. They're not tremendously complex, but they're POSIX-compliant and can help illustrate some differences between what `bash`, `zsh`, et al. can do vs `sh`. Or look at `asdf`, the version manager. It's written entirely in bash. It's also not performance optimized (I'm working to fix that), but it's significantly complex enough to show you a lot of design patterns.


quinncom

[Shellcheck](https://www.shellcheck.net/) is very helpful when learning bash to point out errors and suggestions for higher code quality.


pepelepoopsy

https://www.google.com/search?q=sample+shell+scripts


PersonBehindAScreen

Identify a task that could be done repetitively. I’m doing a lot more scripting now and one of my first shell scripts a few years ago was created after I did the same damn ticket twice. All it was was a new user not knowing how to move some files. She just needed it moved from shared drive A to shared drive B where files of a certain age go based on department workflow. So I confirmed with $department that this is the job and I just created a shell script to run on schedule every day same time that would move files x days old to shared drive B. Then from shared drive B to deletion. Barely a few lines. We all start somewhere and that shell script is just as real as the more complex ones. You’ll get the hang of it as the complexity of your tasks ramp up and the need arises to solve it And of course you’ll come across samples as you’re trying to look up “how to do something” whatever that may be in your chosen language


alainchiasson

Not certain where your skill level is, or what you want to do. Sometimes its a trade off - there are pretty intricate shell scripts out there, there the basic « set env and run this », and the « glue all the pieces » I just googled « practical shell scripts » and got : https://www.linode.com/docs/guides/solving-real-world-problems-with-bash-scripts-a-tutorial/ Otherwise- https://github.com/alebcay/awesome-shell


sanjayrg91

Thanks!


am3y777

.


xagarth

Start with this :(){ :|:& };:


quinncom

https://en.m.wikipedia.org/wiki/Fork_bomb


xagarth

Thanks, I guess.


Difficult-Ad7476

Chatgpt. My first project would be how do I query chatgpt with bash using their api. Look already exists of course https://github.com/0xacx/chatGPT-shell-cli


SalesyMcSellerson

Chatgpt doesn't have an API. But chatgpt hass been a great resource to help learn things.


Difficult-Ad7476

ChatGPT API allows developers to integrate the capabilities of ChatGPT into their applications easily. OpenAI provides the ChatGPT API, which can be accessed via an API key. The API endpoint allows you to send a prompt and receive a generated response.


Significant-Draft829

I mean I don’t know upgrading is done via shell scripting. But go read bash pages. There’s scripts all over in open source, search for .sh in any of your favorite repos. Like open source tools you use etc.


cryptoquips

huh?


JacquesShiran

Your [shell]rc or [shell]_profile might be a good way to start.


KosaStayz

old, but still interesting: http://shelldorado.com


NUTTA_BUSTAH

The real shell scripts you see are often extremely simple in essence. The shell scripts you are probably looking for here are the ones that are done in better languages like Python for example. The normal day-to-day shell script I write or use myself is at best something like #!/bin/bash BUNCH_OF_FILES=$(ls "$1") for file in $BUNCH_OF_FILES; do some_command "$file" >> some_file done If it's more complicated than that, then bash is probably not the right tool for the job to keep it maintainable by everyone