[-] Zucca@sopuli.xyz 2 points 1 hour ago

I had several tests at the beginning of the script. These tests define the "low-level" functions based the capability of the shell. To test new features I "simply" ran all the necessary commands on the test environments (bash, busybox, toybox+mksh).

The script would error out if some necessary capability was missing from the host system. It also had a feature to switch shell if it found a better one (preferring busybox and its internal tools).

Yeah... It was tedious process. It was one of those "I'll write a simple script. So simple that it'll work on almost every posixy shell."... rest is history.

[-] Zucca@sopuli.xyz 3 points 13 hours ago* (last edited 13 hours ago)

I would then assume those scripts weren't written properly to begin with.

But yes, shell scripts should be used (normally) to automate some simple tasks (file copying, backups...) or as an wrapper to exec some other program. I've written several shell scripts to automate things on my personal machines.

However shell script can be complex program while at the same time being (somewhat) easy to maintain:

  • functions, use functions, alot
    • comment every function and describe what it expects in stdin or as an arguments
    • also comment what it outputs or sets

This way at least I don't break my scripts, when I need to modify a function or some way extend my scripts. Keeping the UNIX philosophy inside shell scripts: let one function do one thing well.

And of course: YMMV. People have wastly different coding standards when it comes to personal little(?) projects.

[-] Zucca@sopuli.xyz 3 points 14 hours ago
  • utilize awk if you need to process (=more complex than just grepping) large amounts of text.
    • make your awk code conform to at least busybox awk for compability

I once did a sh script that needed (because I wanted a challenge?) to be compatible with vanilla Android shell too. So I needed to test it with regular bash, busybox and mksh+toybox. That was 'fun'.

I've had some initial plans to spllit the code out from that project and develop a "shell" library that would ease building shell scripts that are compatible with different systems... But I bet someone else has already done that.

[-] Zucca@sopuli.xyz 4 points 14 hours ago

$() instead of

So much this!

[-] Zucca@sopuli.xyz 1 points 4 days ago
[-] Zucca@sopuli.xyz 2 points 5 days ago

Mökillä, mutta liekö taas korona tai sitten alleegiat vieneet kaiken tehon. Eikä nuo saatavilla olleet allergialääkkeet ainakaan auta väsymykseen, muut oireet ne kyllä vie.

18
submitted 1 week ago by Zucca@sopuli.xyz to c/linux@sopuli.xyz
[-] Zucca@sopuli.xyz 58 points 4 weeks ago

Like 65534 times.

So close to full 16-bit max. So close...

[-] Zucca@sopuli.xyz 19 points 1 month ago

Rolling with Gentoo here. Reinstall is not performed even when complete hardware upgrade has been done.

10
submitted 8 months ago by Zucca@sopuli.xyz to c/suomi@sopuli.xyz
26
submitted 9 months ago by Zucca@sopuli.xyz to c/suomi@sopuli.xyz
[-] Zucca@sopuli.xyz 34 points 10 months ago

My short answer:

Should I switch to Wayland?

Yes.

Applications that don't cope with wayland still work via Xwayland. Go ahead.

[-] Zucca@sopuli.xyz 57 points 10 months ago

This is what's wrong in so many countries.

6
submitted 10 months ago* (last edited 10 months ago) by Zucca@sopuli.xyz to c/suomi@sopuli.xyz

Politiikassa toiminut 35-vuotias mies ajoi vappuaattona vuonna 2022 liikenteeltä vappujuhlinnan vuoksi suljettua Pohjoisesplanadia ja sen lähikatuja. Enimmillään nopeutta oli 109 kilometriä tunnissa. Kuten vappuna aina, paikalla oli sankka joukko ihmisiä.

Ei vissiin oikeus voittanut?

Mutta:

Mies tunnusti jo poliisille, että tapahtumat etenivät kuten syytteessä myöhemmin kuvattiin. Mielentilatutkimuksessa kävi kuitenkin ilmi, että hän oli tapahtumahetkellä syyntakeeton.

Kiinnostais tietää vähän enemmän.

9
submitted 10 months ago by Zucca@sopuli.xyz to c/suomi@sopuli.xyz
14
submitted 10 months ago* (last edited 10 months ago) by Zucca@sopuli.xyz to c/linux@sopuli.xyz

IBM/RedHat obviously missing from the member list.

EDIT: CiQ is also a member of resf.

1
submitted 10 months ago by Zucca@sopuli.xyz to c/suomi@sopuli.xyz

Saakohan Tykkimäki nyt kävijätilastoihin pienen piikin..? 😜

[-] Zucca@sopuli.xyz 23 points 10 months ago

Whoa! So RISC-V is already that far? We can have tablets? Nice.

I'm almost in "shut up and take my money" -mode already.

[-] Zucca@sopuli.xyz 70 points 11 months ago

Yes. I think Aaron would want to take his name off from there.

0
submitted 11 months ago by Zucca@sopuli.xyz to c/suomi@sopuli.xyz

Itse olen monesti jättänyt hakematta kelan työttömyystukia, mikäli olen ollut osa-aika -sopparilla töissä. Se mitä joutuu tekemään sen eteen, että saa kelalta pari kymppiä kuussa lisää ei vaan ole sen arvoista. Puhumattakaan, että jos on siinä rajoilla, ni voi olla että päättävät myöhemmin periä takaisin tukia.

Pari kertaa kokenut tämän takaisinperinnän (yksi niistä juurikin opiskelijana) ja sen takia jos joudun ikinä taas tilanteeseen, että on oikeus saada mitään kelan tukia, niin harkitsen tarkkaan ennenkö laitan hakemuslappuset eteenpäin.

Kyllä ,on jäänyt aavistuksen paska maku kelan toilailuista suuhun.

view more: next ›

Zucca

joined 1 year ago