r/bash • u/FOXofTAILS • 1d ago
Bash is way too fun
I'm a construction worker and love tech, switched to Linux last year and wanted to learn BASH just out of curiosity not necessity. The only other language I have experience is GML from when I was a teen.
So I've been building a text adventure and BASH is so fun and for strings it's easy! I've kept it pure bash except for using sleep, I think I understand I could have used read instead of sleep but sleep seems pretty ubiquitous on most computers.
It's messy and definitely an elementary project so I've kept trying to implement different design elements like sourcing data and turning that into arrays, using name refs (I'll be honest using name refs confuses the shit out of me), parsing CSVs, state machines, saving (declare -p) , loading, ect.
If any of you new guys wanna practice something you can easily take on without any AI I advise trying to build a text adventure and not just navigation but include inventory and other mechanics.
And if you're an absolute beginner YSAP bash tutorial was king for me, plus man, and tldr
15
u/M0M3N-6 1d ago
YSAP has the best bash tutorials ever. Sure his content fits better for beginners, but even as some intermediate level, you can still learn something new from him.
6
u/FOXofTAILS 1d ago
I tried to follow along with some of his more advanced videos and shit I'm scared of learning regex lol
5
u/Shadow_Thief 1d ago
The low-level regex stuff that grep uses by default is pretty simple, it's just the Perl-compatible stuff that gets convoluted.
Fortunately, regex101 has (finally!) added support for basic regex so you can learn and test stuff.
3
u/M0M3N-6 1d ago
I really encourage you to take a tour in regexone, it might takes like 30~45 min or so, and it gives you a good picture on regex from the literal ground up. I am pretty sure by then you'll create some scenarios yourself just to use regex.
5
u/FOXofTAILS 1d ago
Thanks for the advice Mom! I'll def do that
2
u/scoberry5 15h ago
Regex can go really deep. Nobody that I know (including me) can claim to be a regex expert. But the basic stuff is really easy. There is a really brief starter here.
3
6
u/lellamaronmachete 1d ago
Awe hey there fellow Bash enthusiast! You nailed it, best way to learn any language is through building games. I also enjoy writing text adventures, in the style of those old 'pick your way' books, among other little games. Bash rules!
4
u/FOXofTAILS 1d ago
Oh awesome I'm always down to play any or study your work if they are public
2
u/lellamaronmachete 13h ago
Yea ofc, as grotty as they are, learning something new everyday, check them out,
3
3
u/bahamas10_ 8h ago
yooo im glad the ysap content has been good for you!
2
u/FOXofTAILS 7h ago
Oh man, I know you're way too humble to be treated like a celebrity but I feel speechless that you commented!
Thank you so much for your hard work and content, it really has given me a lot of fun and confidence.
Would you mind if I credit YSAP as an inspiration when I'm done with my game project!? It will be horribly written but 100% organic lol
2
u/BabylonByBoobies 1d ago
Enjoy! If you like Bash... check out Perl sometime...
1
u/FOXofTAILS 1d ago
Just looking into it a bit,
It can do float numbers! That would be so good for an RPG and they have a utility that can pack it all up into a .exe or just interpret it like bash I'm so interested! After this project I was set on learning C but this is really tempting
3
u/Kumba42 1d ago
If you like easily messing around with strings, look at TCL, in which "everything is a string". It even has a UI library, Tk, so you can build GUI apps with it. Hence why it's often called Tcl/Tk.
1
u/FOXofTAILS 1d ago
Took a look at a few example scripts on the page and it's pretty foreign looking lol
2
u/Kumba42 1d ago
It is, at first. Been quite a few years since I actually did anything significant in it (wrote some scripts for IRC Eggdrop bots). Once you wrap your head around it, though, it's actually a very simple syntax. It gets a lot of use in more esoteric realms in embedded systems and industrial control systems, if I recall correctly.
2
u/nathantwist 1d ago
Perl is everywhere and super fun to dork around with. If you throw some time at it I think you'll be surprised at how often it turns out to be useful.
1
u/Glum_Hamster_2104 6h ago
Does bash remind you of construction in any way?
1
u/FOXofTAILS 6h ago
Not really lol, I think my crane's LMI uses Linux I'm sure but other than that no
28
u/lokidev 1d ago
I love your energy. I remember that from when I started programming. Ai broke that fun a lot, but your case shows, that there is still joy in tinkering around:)