转发: Re: [shlug] [OT]Linux下Path环境变量有长度限制么?

64 views
Skip to first unread message

LIU WEIGANG

unread,
Dec 10, 2014, 4:30:38 AM12/10/14
to sh...@googlegroups.com
目前没发现ubuntu的环境变量path超出的问题,软件装了是不少,大小软件和附带软件加起来有上百了吧,暂没发现问题。回去计算一下path字符串的长度后再告诉你。这个不知道跟32位和64位有没有关系,不知哪位大牛能否释疑一下。



----- 转发的邮件 -----
发件人:liyaoshi<liya...@gmail.com>
发送时间:2014年12月10日 11:07
收件人:sh...@googlegroups.com<sh...@googlegroups.com>
主题:Re: [shlug] [OT]Linux下Path环境变量有长度限制么?

windows 目录长度是256字节

在 2014年11月29日 下午5:41,赵锦威 <clar...@gmail.com>写道:

问这个问题是因为今天在Windows下发现Win下的Path环境变量居然是有长度限制的。。。所以就想来请教一下Linux下对Path有没有限制。。。

再OT一下,假设我现在Win下现有的Path是一个长度为n的字符串,现在要安装一个新的软件,该软件需要添加的Path环境变量的长度为m。假如m+n超过了Windows的限制,会发生什么情况?会不会把原来长度为n的Path全部替换为m。。。

(问这个是因为今天装CTeX的时候,装完之后发现Path全部变成CTeX的环境变量了。。。安装前我备份过Path,然后我把备份前的Path加上CTeX新注册的Path,发现超过Windows的限制了。。。CTeX的官网自己也说有时候会发生Path丢失的问题。。。所以我开了个脑洞想会不会就是因为超限了呢?)

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout

Doyle

unread,
Dec 10, 2014, 6:08:39 AM12/10/14
to sh...@googlegroups.com

遇到过path 过长的情况,没注意当时有多长,但看上去在256左右。
解决办法是再建一个环境变量,把一堆路径放到那个新变量里,然后path里用%新变量%的方式绕过的。

依云

unread,
Dec 10, 2014, 8:27:12 AM12/10/14
to sh...@googlegroups.com
On Wed, Dec 10, 2014 at 07:08:35PM +0800, Doyle wrote:
> 遇到过path 过长的情况,没注意当时有多长,但看上去在256左右。
> 解决办法是再建一个环境变量,把一堆路径放到那个新变量里,然后path里用%新变量%的方式绕过的。

双百分号 233…………………………

--
Best regards,
lilydjwg

Linux Vim Python 我的博客:
http://lilydjwg.is-programmer.com/
--
A: Because it obfuscates the reading.
Q: Why is top posting so bad?

Doyle

unread,
Dec 10, 2014, 9:20:42 PM12/10/14
to sh...@googlegroups.com
(因为一开始是windows 上遇到path 过长不是吗?)
(我是说,为什么233)
(求笑点)
(括号内文字表示语气减弱……所以整个恢复是弱弱的问……)

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。

david pu

unread,
Dec 10, 2014, 9:21:32 PM12/10/14
to sh...@googlegroups.com
Linux的话PATH变量的长度最后归结为ARG_MAX的限制。
getconf ARG_MAX可以查

2014-12-10 21:26 GMT+08:00 依云 <lily...@gmail.com>:
> --
> -- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
> ---
> 您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
> 要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
> 要查看更多选项,请访问 https://groups.google.com/d/optout



--
() ASCII Ribbon Campaign
/\ Keep it simple!

依云

unread,
Dec 11, 2014, 12:45:55 AM12/11/14
to sh...@googlegroups.com
On Thu, Dec 11, 2014 at 10:20:17AM +0800, Doyle wrote:
> (因为一开始是windows 上遇到path 过长不是吗?)
> (我是说,为什么233)
> (求笑点)
> (括号内文字表示语气减弱……所以整个恢复是弱弱的问……)

咦一开始是讨论 Windows 的么?这个 thread 被转发过,丢失了更早的 thread
信息(是的,我看到了,原 thread 在我这里,上上上上边,没在一起所以没一起
看)。而且标题里写的是 Linux 呀,虽然 PATH 的大小写不对。

--
Best regards,
lilydjwg

赵锦威

unread,
Dec 11, 2014, 12:51:42 AM12/11/14
to sh...@googlegroups.com
哎是这样的,是一开始在Windows上碰到了PATH过长的情况。。然后开脑洞来问Linux上对PATH有没有限制。。。

在 2014年12月11日星期四UTC+8下午1时45分55秒,依云写道:
Reply all
Reply to author
Forward
0 new messages