Scripts I wrote that I use all the time
11–20 of 408 posts
Re: Scripts I wrote that I use all the time
#12sed, awk, grep, and xargs along with standard utilities get you a long long way.
Re: Scripts I wrote that I use all the time
#13Earlier quoted context omitted.
The nato phonetic alphabet one cracked me up. My dude you don't need that, call center employees don't know it, just say S as in Sugar like ur grandma used to.
The nato phonetic alphabet is still useful even if the other party doesn't know it, I've used it a bunch of times on the phone to spell out my 10- letter last name. Saves quite a lot of time and energy for me vs saying "letter as in word" for each letter.
Which often just confuses things further.
Me: My name is "Farb" F-A-R-B. B as in Baker.
Them: Farb-Baker, got it.
Re: Scripts I wrote that I use all the time
#14Regarding the `line` script, just a note that sed can print an arbitrary line from a file, no need to invoke a pipeline of cat, head, and tail: sed -n 2p file prints the second line of file. The advantage sed has over this line script is it can also print more than one line, should you need to: sed -n 2,4p file prints lines 2 through 4, inclusive.
Re: Scripts I wrote that I use all the time
#15It's weird how the circle of life progresses for a developer or whatever. - When I was a fresh engineer I used a pretty vanilla shell environment - When I got a year or two of experience, I wrote tons of scripts and bash aliases and had a 1k+ line .bashrc the same as OP - Now, as a more tenured engineer (15 years of experience), I basically just want a vanilla shell with zero distractions, aliases or scripts and use…
Re: Scripts I wrote that I use all the time
#16Regarding the `line` script, just a note that sed can print an arbitrary line from a file, no need to invoke a pipeline of cat, head, and tail: sed -n 2p file prints the second line of file. The advantage sed has over this line script is it can also print more than one line, should you need to: sed -n 2,4p file prints lines 2 through 4, inclusive.
It is often useful to chain multiple sed commands and sometimes shuffle them around. In those cases I would need to keep changing the fist sed. Sometimes I need to grep before I sed. Using cat, tail and head makes things more modular in the long run I feel. It’s the ethos of each command doing one small thing
Re: Scripts I wrote that I use all the time
#17This is exactly the kind of stuff I'm most interested in finding on HN. How do other developers work, and how can I get better at my work from it? What's always interesting to me is how many of these I'll see and initially think, "I don't really need that." Because I'm well aware of the effect (which I'm sure has a name - I suppose it's similar to induced demand) of "make $uncommon_task much cheaper" -> "$uncommon_ta…
Re: Scripts I wrote that I use all the time
#18It's weird how the circle of life progresses for a developer or whatever. - When I was a fresh engineer I used a pretty vanilla shell environment - When I got a year or two of experience, I wrote tons of scripts and bash aliases and had a 1k+ line .bashrc the same as OP - Now, as a more tenured engineer (15 years of experience), I basically just want a vanilla shell with zero distractions, aliases or scripts and use…
Now I have many nix computers and I want them consistent and with only the most necessary packages installed.
Re: Scripts I wrote that I use all the time
#19It's weird how the circle of life progresses for a developer or whatever. - When I was a fresh engineer I used a pretty vanilla shell environment - When I got a year or two of experience, I wrote tons of scripts and bash aliases and had a 1k+ line .bashrc the same as OP - Now, as a more tenured engineer (15 years of experience), I basically just want a vanilla shell with zero distractions, aliases or scripts and use…
Personally I tend to agree... there is a very small subset of things I find worth aliasing. I have a very small amount and probably only use half of them regularly. Frankly I wonder how my use case is so different.
edit: In the case of the author I guess he's probably wants to live in the terminal full time. And perhaps offline. there is a lot of static data he's stored like http status codes: https://codeberg.org/EvanHahn/dotfiles/src/commit/843b9ee13d...
In my case i'd start typing it in my browser then just click something i've visited 100 times before. There is something to be said about reducing that redundant network call but I dont think it makes much practical difference and the mental mapping/discoverability of aliases isnt nothing.
Re: Scripts I wrote that I use all the time
#20Earlier quoted context omitted.
The nato phonetic alphabet is still useful even if the other party doesn't know it, I've used it a bunch of times on the phone to spell out my 10- letter last name. Saves quite a lot of time and energy for me vs saying "letter as in word" for each letter.
> saying "letter as in word" for each letter Which often just confuses things further. Me: My name is "Farb" F-A-R-B. B as in Baker. Them: Farb-Baker, got it.