Re: See repeated /usr/bin in my path

2024-04-19 Thread J M via Cygwin
El jue., 18 abr. 2024 18:50, Andrey Repin  escribió:

> Greetings, J M!
>
> > Isn't it better that original_path be removed all startwith
> > $mycygwin_homepath?
>
> $original_path is stored once when you first run Cygwin with empty home
> profile, IIRC. And not used anywhere.
> ,
> > You have this scriptlet, but if you need all to work with all Linux
> > distributions you need yo add unnecessary work, multiple code and cases
> for
> > all, and complicate all.
>
> It's in ~/.bashrc.d/. And not copied over to *NIX systems.
>
> P.S.
> Please do not top-post in this list.
>
>
> --
> With best regards,
> Andrey Repin
> Thursday, April 18, 2024 19:39:05
>
> Sorry for my terrible english...
>

Thank you Andrew, I didn't know the meaning of top-posting, using gmail
puts you at the beginning. And my english is very poor, I'm spanish.

Then, over this problem, its a pretty form to change the behaviour of
Cygwin from outside, simply setting the path cygwin64... the way you want.
Its a side effect... Appart of failed scripts, and I'm not in the security
branches, its a pretty form to inyect things to change behavihours.

I recommend to disable or erase all paths that refer to C:\cygwin64 or root
path.

For reference, here https://gist.github.com/mpicker0/a6a3f10e6b9278074f93,
show the use of Windows environment variable C:\cygwin64\bin.

Regards

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: See repeated /usr/bin in my path

2024-04-18 Thread Eliot Moss via Cygwin

On 4/18/2024 12:41 PM, Andrey Repin via Cygwin wrote:

Greetings, J M!


Isn't it better that original_path be removed all startwith
$mycygwin_homepath?


$original_path is stored once when you first run Cygwin with empty home
profile, IIRC. And not used anywhere.


That seems to be ORIGINAL_PATH (upper case variable name).

Regards - Eliot Moss

--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: See repeated /usr/bin in my path

2024-04-17 Thread J M via Cygwin
Hi Andrew,

Isn't it better that original_path be removed all startwith
$mycygwin_homepath?

You have this scriptlet, but if you need all to work with all Linux
distributions you need yo add unnecessary work, multiple code and cases for
all, and complicate all.

Regards

El mié., 17 abr. 2024 23:35, Andrey Repin  escribió:

> Greetings, J M!
>
> > I think that is a bug, in my Windows environment path I have this:
> > C:\cygwin64\bin
>
> > Then for some mystery change this to /usr/bin, instead to delete.
> > You can file an issue?
>
> It's not a bug, it's how Cygwin works.
> If you want to have Cygwin in your system PATH, you'll have to, either
> a) tolerate the duplicated entries in session's $PATH, or
> b) do something to fix it.
>
> I use this scriptlet:
>
> PATH="$( tr ":" "\\n"
> <<<"$HOME/bin:$HOME/.local/bin:/usr/local/bin:/bin:$PATH" | sed -Ee "1,4b;
> \\#Subversion|$HOME|^(/usr(/local)?)?/bin\$#d;" | paste -sd:)" export PATH
>
> (Essentially, I push 4 predefined paths on top of the stack, then filter
> out
> the rest of the stack by some known patterns.)
>
>
> --
> With best regards,
> Andrey Repin
> Thursday, April 18, 2024 00:07:59
>
> Sorry for my terrible english...
>
>

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: See repeated /usr/bin in my path

2024-04-17 Thread Andrey Repin via Cygwin
Greetings, J M!

> I think that is a bug, in my Windows environment path I have this:
> C:\cygwin64\bin

> Then for some mystery change this to /usr/bin, instead to delete.
> You can file an issue?

It's not a bug, it's how Cygwin works.
If you want to have Cygwin in your system PATH, you'll have to, either
a) tolerate the duplicated entries in session's $PATH, or
b) do something to fix it.

I use this scriptlet:

PATH="$( tr ":" "\\n" <<<"$HOME/bin:$HOME/.local/bin:/usr/local/bin:/bin:$PATH" 
| sed -Ee "1,4b; \\#Subversion|$HOME|^(/usr(/local)?)?/bin\$#d;" | paste -sd:)" 
export PATH

(Essentially, I push 4 predefined paths on top of the stack, then filter out
the rest of the stack by some known patterns.)


-- 
With best regards,
Andrey Repin
Thursday, April 18, 2024 00:07:59

Sorry for my terrible english...


-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: See repeated /usr/bin in my path

2024-04-17 Thread Doug Henderson via Cygwin
On Wed, Apr 17, 2024 at 11:11 AM J M via Cygwin  wrote:
>
> Hi,
>
> I see repeated /usr/bin in my path.
> I don't known if is something of my PC or not.
>
> To check I do:
> which -a ls
> Show:
> /usr/bin/ls
> /usr/bin/ls

This is normal! We do this because on Linux, the two paths may be different,
e.g on different file systems.

Try this:
$ ls -li $(which -a ls)
5910974510956900 -rwxr-xr-x 1 Admin None 148K Jul 14  2022 /bin/ls*
5910974510956900 -rwxr-xr-x 1 Admin None 148K Jul 14  2022 /usr/bin/ls*

and look at
$ mount
C:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin64 on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)

which shows that /usr/bin is mounted on C:/cygwin64/bin which,
inside the cgywin environment, is /bin
because on my system C:/cygwin64/ is the root e.g. /

HTH
Doug

-- 
Doug Henderson, Calgary, Alberta, Canada - from gmail.com

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: See repeated /usr/bin in my path

2024-04-17 Thread J M via Cygwin
I think that is a bug, in my Windows environment path I have this:
C:\cygwin64\bin

Then for some mystery change this to /usr/bin, instead to delete.
You can file an issue?

Regards




El mié, 17 abr 2024 a las 19:10, J M ()
escribió:

> Hi,
>
> I see repeated /usr/bin in my path.
> I don't known if is something of my PC or not.
>
> To check I do:
> which -a ls
> Show:
> /usr/bin/ls
> /usr/bin/ls
>
> My path is:
> /usr/local/bin
> /usr/bin
> ...
> /usr/bin
> ...
>
> Seeing other files, I reach to /etc/profile and use one variable
> ORIGINAL_PATH that contains one /usr/bin.
>
> But I can no longer see where that variable is set or if it is not from
> Cygwin.
>
> Regards
>
>

-- 
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple