Auteur Topic: (B)ash  (gelezen 705 keer)

Offline webkabouter

  • Bedankjes
  • -Gegeven: 37
  • -Ontvangen: 11
  • Berichten: 202
(B)ash
« Gepost op: 23 oktober 2021, 10:09:27 »
[Linux Syno716 3.10.108 #41890 SMP Fri Jun 25 02:39:26 CST 2021 x86_64 GNU/Linux synology_braswell_syno]

Bij het checken welke shell ik gebruik

# printf "My current shell - %s\n" "$SHELL"

krijg ik dit te zien:

My current shell - /bin/ash

Is dit een bash variant en waarom zie ik dan in mijn homedir geen .ashrc oid?
  • Mijn Synology: DS716Plus2
  • HDD's: 2 x WD10EFRX-68FYTNO
  • Extra's: 8Gb
-- met twee voeten aan de grond kom je geen stap verder

Offline DSGebruiker

  • MVP
  • *
  • Bedankjes
  • -Gegeven: 5
  • -Ontvangen: 119
  • Berichten: 770
Re: (B)ash
« Reactie #1 Gepost op: 23 oktober 2021, 10:21:26 »
https://github.com/ash-shell/ash

The .ashrc File
The .ashrc file is a file loaded in by the Ash core which you can use in configuring your modules. The .ashrc file is located in your home directory ~/.ashrc (you're going to have to create this file yourself).

This file is optional in terms of the Ash core, but may be required for some modules that require an .ashrc configuration.

It's worth noting that this is the first thing that is loaded in Ash, so module writers don't have to worry about a users .ashrc causing any variable/function collisions with their modules, as everything in your module is loaded after and will take priority.


Exact waarom dat zal je aan Synology moeten vragen.
En anders gewoon zelf die file maken en erin zetten wat je erin wil hebben staan hé.

Offline webkabouter

  • Bedankjes
  • -Gegeven: 37
  • -Ontvangen: 11
  • Berichten: 202
Re: (B)ash
« Reactie #2 Gepost op: 23 oktober 2021, 10:31:00 »
Thanks.
Je schrijft 'the Ash core which you can use in configuring your modules'. Is dat iets anders dan een shell?
Normaliter heeft een unix systeem een shell zoals bv bash of csh standaard ingebakken.
  • Mijn Synology: DS716Plus2
  • HDD's: 2 x WD10EFRX-68FYTNO
  • Extra's: 8Gb
-- met twee voeten aan de grond kom je geen stap verder

Offline DSGebruiker

  • MVP
  • *
  • Bedankjes
  • -Gegeven: 5
  • -Ontvangen: 119
  • Berichten: 770
Re: (B)ash
« Reactie #3 Gepost op: 23 oktober 2021, 11:58:01 »
Ik denk dat Synology dit framework gebruikt om oa vanwege onderstaande ;
Op die NAS'sen staan een hoop scripts & tools die aangeroepen worden vanuit DSM en "Ash" zal het ontwikkelen denkelijk makkelijker maken ? Geen idee eigenlijk.

Ik gebruik m'n NAS echt maar zeer zelden op shell. Voor shell zaken gebruik ik gewoon Linux machines die gewoon "off the shelf" zijn geinstalleerd en niet een customized omgeving zoals de Linux die Synology gebruikt.

---------------------
Ash is a modular Bash framework written with ease of use + reusability in mind.

Building command line tools in Bash is an extremely tedious and somewhat enigmatic task. There's quite a bit of boilerplate code you're going to have to write if you want your script to do more than just one thing, which will only clutter your script. In addition, your scripts will likely never be able to reference good code you've written from old scripts.

Ash helps you get rid of all of your boilerplate by letting you call functions directly from the command line, while also providing a modular approach to scripting which will allow you to share code between scripts.
---------------------

Offline Briolet

  • Global Moderator
  • MVP
  • *
  • Bedankjes
  • -Gegeven: 181
  • -Ontvangen: 2693
  • Berichten: 16.631
Re: (B)ash
« Reactie #4 Gepost op: 23 oktober 2021, 12:43:01 »
Tot DSM 5 werd ash gebruikt. Sinds DSM 6 is het bash. En volgens mij gebruikt SRM nog steeds ash.

@webkabouter : Je geeft niet aan welke DSM versie je gebruikt. Onder DSM 6.2 zie ik:

$ printf "My current shell - %s\n" "$SHELL"
My current shell - /bin/sh

$ file -h /bin/sh
/bin/sh: symbolic link to bash

Dus geen ash. En de sh wijst via een simlink naar bash
  • Mijn Synology: DS415+
  • HDD's: 3x 3TB in SHR
  • Extra's: DS212J, RT1900ac