Re: Make cd built-in as resilient as mkdir -p built-in

2025-04-14 Thread Chet Ramey
On 4/12/25 3:29 AM, Laurent Lyaudet wrote: Le ven. 11 avr. 2025 à 18:11, Chet Ramey > a écrit : On 4/10/25 12:29 PM, Laurent Lyaudet wrote: > Hello :), > > Recently, I noticed during tests that mkdir -p can handle paths beyond > PATH_MAX tha

Re: Make cd built-in as resilient as mkdir -p built-in

2025-04-12 Thread Laurent Lyaudet
Le ven. 11 avr. 2025 à 18:11, Chet Ramey a écrit : > On 4/10/25 12:29 PM, Laurent Lyaudet wrote: > > Hello :), > > > > Recently, I noticed during tests that mkdir -p can handle paths beyond > > PATH_MAX that is currently 4096. > > But cd cannot do this. > > POSIX requires cd to fail in this case,

Re: Make cd built-in as resilient as mkdir -p built-in

2025-04-11 Thread Chet Ramey
On 4/10/25 12:29 PM, Laurent Lyaudet wrote: Hello :), Recently, I noticed during tests that mkdir -p can handle paths beyond PATH_MAX that is currently 4096. But cd cannot do this. POSIX requires cd to fail in this case, leaving the current directory unchanged. -- ``The lyf so short, the cra

Re: Make cd built-in as resilient as mkdir -p built-in

2025-04-10 Thread Laurent Lyaudet
Le jeu. 10 avr. 2025 à 18:29, Laurent Lyaudet a écrit : > Hello :), > > Recently, I noticed during tests that mkdir -p can handle paths beyond > PATH_MAX that is currently 4096. > But cd cannot do this. > You have to split your cd commands to go to the farthest directory. > > I think that cd cann

Re: Make cd built-in as resilient as mkdir -p built-in

2025-04-10 Thread Laurent Lyaudet
Le jeu. 10 avr. 2025 à 18:30, Laurent Lyaudet a écrit : > > > Le jeu. 10 avr. 2025 à 18:29, Laurent Lyaudet > a écrit : > >> Hello :), >> >> Recently, I noticed during tests that mkdir -p can handle paths beyond >> PATH_MAX that is currently 4096. >> But cd cannot do this. >> You have to split y

Make cd built-in as resilient as mkdir -p built-in

2025-04-10 Thread Laurent Lyaudet
Hello :), Recently, I noticed during tests that mkdir -p can handle paths beyond PATH_MAX that is currently 4096. But cd cannot do this. You have to split your cd commands to go to the farthest directory. I think that cd cannot move if it fails. In case of error, it must keep bash in the same cur