On Fri, 9 Jul 2021 16:53:45 -0400
Greg Wooledge wrote:
> Since it's a function, and not a script, there's no shebang. So I'm
> guessing shellcheck assumed it was /bin/sh code, rather than bash
> code. <<< is just one of the bashisms I used here. local is
> another. The use of arrays is a third
On Fri, Jul 09, 2021 at 11:40:36PM +0200, john doe wrote:
> On 7/9/2021 9:54 PM, Charles Curley wrote:
> > # if [[ ! ${PATH} =~ .*/home/charles/.local/bin.* ]] ; then
>
> [[ $PATH =~ \/home\/charles\/... ]] && echo match || echo nomatch
>
> That is, escaping the backslash.
First, you are escapin
On 7/9/2021 9:54 PM, Charles Curley wrote:
I'd like to check two things:
* Whether a given path is not already in the $PATH variable
* Whether the given path already exists
If both are true, I'd like to add the given path to the $PATH variable.
I can add the given path, and test for the exist
On Fri, Jul 09, 2021 at 02:45:23PM -0600, Charles Curley wrote:
> On Fri, 9 Jul 2021 16:25:11 -0400
> Greg Wooledge wrote:
>
> > add_path_maybe() {
> > local p i
> > ...
>
> Very nice, sir. Thank you.
>
> shellcheck complained about the redirection in the "IFS=: read" line,
> but I'm not goin
On Fri, 9 Jul 2021 16:25:11 -0400
Greg Wooledge wrote:
> add_path_maybe() {
> local p i
> ...
Very nice, sir. Thank you.
shellcheck complained about the redirection in the "IFS=: read" line,
but I'm not going to worry about that.
--
Does anybody read signatures any more?
https://charlescu
On Fri, 9 Jul 2021 22:11:05 +0200
Joerg Kampmann wrote:
> > I call the script with the . operator: ". test.sh"
> this is the result:
>
>
> root@primergy:~/software-env# . test.sh
>
> Substr is /root/.local/bin/
> Substring NOT found.
> root@primergy:~/software-env#
OK, that's what I get if
I am sorry I found myself in the wrong thread ... so discard
Am 09.07.21 um 22:25 schrieb Greg Wooledge:
On Fri, Jul 09, 2021 at 01:54:19PM -0600, Charles Curley wrote:
I'd like to check two things:
* Whether a given path is not already in the $PATH variable
* Whether the given path already e
On Fri, Jul 09, 2021 at 01:54:19PM -0600, Charles Curley wrote:
> I'd like to check two things:
>
> * Whether a given path is not already in the $PATH variable
>
> * Whether the given path already exists
>
> If both are true, I'd like to add the given path to the $PATH variable.
add_path_maybe(
Am 09.07.21 um 21:54 schrieb Charles Curley:
I'd like to check two things:
* Whether a given path is not already in the $PATH variable
* Whether the given path already exists
If both are true, I'd like to add the given path to the $PATH variable.
I can add the given path, and test for the e
9 matches
Mail list logo