b9AcE #NoEdits on Nostr: Welll, OK, it may have happened that I made a mistake in a BASH UNIX(/Linux) script ...
Welll, OK, it may have happened that I made a mistake in a BASH UNIX(/Linux) script or two(hundred ;-P),
but so how do you find those mistakes?
One good way is to tell BASH to just tell you everything it actually ran, what it interpreted the script as you having told it to do, explicitly, with "-x".
Very easy, just run your BASH (Bourne Again SHell, because he original UNIX-shell ("sh") was by a person named Bourne, so the "improved" version is the "Bourne Again"-shell, BASH... anyway, I digress), like this:
"bash -x script.sh",
then it will run your script which in that example would have been "script.sh" while printing out every command it ran, with every variable expanded to what it understood it as, etc.
Very nifty, for people that may make mistakes, like I dnon't do.
Published at
2023-05-03 20:56:44Event JSON
{
"id": "b6e7f489884ff20ce5c2e513afc3ab7ab3386498ed9642e7ae10eee425ba675b",
"pubkey": "adc8fe765f1ee1b5d721a64dee9006277bb03c60824e45d6f5c0f7897485fd4d",
"created_at": 1683147404,
"kind": 1,
"tags": [
[
"e",
"c270e9dde40103ef308c7afac5477e76d15af9a1fcffdcabd7818ec9f9a16737",
"wss://relay.mostr.pub",
"reply"
],
[
"mostr",
"https://todon.eu/users/b9AcE/statuses/110306748294978297"
]
],
"content": "Welll, OK, it may have happened that I made a mistake in a BASH UNIX(/Linux) script or two(hundred ;-P),\nbut so how do you find those mistakes?\n\nOne good way is to tell BASH to just tell you everything it actually ran, what it interpreted the script as you having told it to do, explicitly, with \"-x\".\n\nVery easy, just run your BASH (Bourne Again SHell, because he original UNIX-shell (\"sh\") was by a person named Bourne, so the \"improved\" version is the \"Bourne Again\"-shell, BASH... anyway, I digress), like this:\n\"bash -x script.sh\",\nthen it will run your script which in that example would have been \"script.sh\" while printing out every command it ran, with every variable expanded to what it understood it as, etc.\n\nVery nifty, for people that may make mistakes, like I dnon't do.",
"sig": "0586554448c776a77ed1058d82f00f276c948c4cd66b4ccbdc07936974071716143ef1b2cba6bae9f7c006474e7ec1d4682fffbd62a509ece061ac9b111c8988"
}