[SOLVED] Re: when trying to run shutdown -p, i get a Bad substituion Reply #15 – 21 September 2021, 14:23:02 A pure POSIX sh equivalent without pipes would be:Code: [Select][ "${1%%"${1#?}"}" != '-' ] && dieOP should probably forward our code to Eric so he considers it for inclusion on 66.edit: fix quotes Last Edit: 02 October 2021, 21:05:04 by nous 2 Likes
Re: when trying to run shutdown -p, i get a Bad substituion Reply #16 – 21 September 2021, 18:29:12 Quote from: capezotte – on 21 September 2021, 14:23:02Code: [Select][ "${1%%"${1#?}"}" != '-' ] && dieI think you don't need those inner quotes though. Without them (test.sh),Code: [Select]#!/bin/sh[ "${1%%${1#?}}" != '-' ] && echo not minus || echo minusCode: [Select]$ ./test.sh -abc defminus$ ./test.sh abc defnot minus$ ./test.sh '-abc def'minus$ ./test.sh 'abc def'not minus
Re: when trying to run shutdown -p, i get a Bad substituion Reply #17 – 21 September 2021, 19:47:51 Inner quotes are just to handle edge case of ./test.sh '-*abcdef' (and other globbing metacharacters).
Re: when trying to run shutdown -p, i get a Bad substituion Reply #18 – 23 September 2021, 10:32:32 I'v been waiting since day 1 of your first reply and idea to report to upstream, to get approved to that website, as they are supposedly being attacked by spam, and accounts take 1-5 days to get approved, what nonsense xD i can't even do a quick upstream bug report when I want to xD can anyone who already has a acc there, simply report the upstream bug report for me that the script makes a call to a POSIX compliant shell while uses bashisms?
Re: when trying to run shutdown -p, i get a Bad substituion Reply #19 – 23 September 2021, 10:39:47 https://framagit.org/Obarun/66 I would open an issue there
Re: when trying to run shutdown -p, i get a Bad substituion Reply #20 – 23 September 2021, 11:17:45 yeah except that they didn't approve my account, thats what im saying I can't open a issue without a account can i?
Re: when trying to run shutdown -p, i get a Bad substituion Reply #21 – 23 September 2021, 11:22:59 You can maybe try here: Bug report / Obarun forum
Re: when trying to run shutdown -p, i get a Bad substituion Reply #22 – 29 September 2021, 17:08:03 finally got approved and filed a bug report, I'v marked this topic can be closed i guess ... thanks for your help you guys are great 2 Likes
Re: when trying to run shutdown -p, i get a Bad substituion Reply #23 – 29 September 2021, 20:59:11 Quote from: kronikpillow – on 29 September 2021, 17:08:03finally got approved and filed a bug report, I'v marked this topic can be closed i guess ... thanks for your help you guys are great Locally I added a patch for the cmd, until atleast upstream decides to/not to do it.
Re: when trying to run shutdown -p, i get a Bad substituion Reply #24 – 06 October 2021, 13:17:29 seems that the issue is now solved on upstream issue: shutdown script