[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What's In Your Bin Directory /g/?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 20
Thread images: 3
File: bin.png (21 KB, 637x124) Image search: [Google]
bin.png
21 KB, 637x124
Linux extreme casual here. I learned about "Shebang" some time ago. Made some scripts for simple things on my computer. Most are written in python (2.7 and now 3).

What's in your bin? What is your language of choice?
>>
File: bin.png (18 KB, 474x167) Image search: [Google]
bin.png
18 KB, 474x167
My personal bin scripts directory?

3 terminal colour test scripts, ffmpeg record and convert bash script and a screenshot cleanup python script I wrote to avoid cluttering up my WM binds
>>
I had a look on Github a while ago and tried a few scripts, but I don't think I've ever used any of these.
ls ~/bin/
ack emojify h hr spark z.sh


At work I have some useful scripts for
- scheduling downtime in Nagios
- search for a string in filename and open in vim
- run a syntax check on configuration files

I also have a folder of one-off scripts that I use to do text manipulation en masse.
>>
All I have is a script to open QEMU with all of the correct command line arguments.
>>
>>51819589
>My personal bin scripts directory?
Yeah I should have specified ~/bin/
>>
>>51819675
well it's kind of implied anyway
>>
A front end to osmctools that updates large osm files with deltas and cuts sub regions out to make the files easier to deal with in parallel. Turns out this is quicker on a powerful enough machine rather than just downloading the maps over again. Writing it in python 3 this time instead of Bash.
>>
>>51819591
Oh, and favourite language is peasant bash scripting. It's just so easy.
>>
>>51819721
I used to use Bash for everything. For some things it is still the best, but it might be worth learning a dedicated scripting language. Reading from files, and even arrays in bash look like sphagetti compared to python or perl. I find python even easier, and much cleaner.
>>
>>51819762
I've always wanted to, but I've never had a good enough excuse to really dig in to it. It's encouraging to hear that it would help.
>>
File: cakes-cheese.jpg (10 KB, 211x356) Image search: [Google]
cakes-cheese.jpg
10 KB, 211x356
>>51819721
>Bash
>It's just so easy.
Straightforward commands I have no problem with. But I am so slow when trying to implement anything like for-loops or if-statements. And then I always have to remember the difference between ('), (") and (`)...that always bites me in the ass. I guess it isn't hard, it just take me time because I have to look everything up again.
>>
>>51819801
Double quotes escape spaces, single quotes escape everything.
>`
If you use these as quotes, you are scourge of the earth and you deserve every bit of pain you receive.
>>
>>51819788
Look up how to parse arguments in python. That was the deciding factor for me. I still use Bash for a Debian install script since it's just running a bunch of simple commands. Anything more than that and things get ugly quickly in bash.
>>
l u a

to be honest my window manager is scripted in lua so I just told myself I loved it until it felt like I kind of liked it.
>>
>>51819857
Actually (") will replace variable names with their values and other stuff, (') won't replace anything and use literally what is inside, (`) is used for command substitution. All of them have their place for something.
>>
>>51819934
Actually, double quotes don't replace anything. Variable expansion isn't part of double quote functionality and it will happen without them:

echo $HOME


Backticks are depreciated as subshells, use
$(echo "this")
instead.
>>
>>51819984
Fair enough. I guess single quotes just stop variable expansion and not the other way around. And I'll keep that in mind instead of back quoting. I don't write very much Bash anymore though thankfully.
>>
>>51819857
>If you use these as quotes, you are scourge of the earth and you deserve every bit of pain you receive.
Honestly, the initial pain I received caused me to run to the arms of python. I had already been using it for school stuff (numpy/scipy and matplotlib). I just didn't know you could shebang with it.

But much respect to the folks who are fluent in bash scripting. I had to punk out.
>>
>>51820073
>arrays not built in and you have to hack them together
You really aren't missing much unless you just need to run a series of programs. Python is overkill in that case.
>>
>>51819902
A lot of programs and vidya games use Lua scripting. By itself I don't really use it, but when it's the only option to extend something it isn't too bad.
Thread replies: 20
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.