๊ธ€ ์ž‘์„ฑ์ž: ์ด์ง€์›๐ŸŒฉ๏ธ

Shell Script๋ฅผ ์ž‘์„ฑํ•˜๋‹ค๊ฐ€ ๋””๋ ‰ํ„ฐ๋ฆฌ์˜ ํŒŒ์ผ์„ ํƒ์ƒ‰ํ•˜๊ณ , ํƒ์ƒ‰ํ•œ ํŒŒ์ผ์˜ ์ด๋ฆ„์„ ๋ณ€์ˆ˜์— ์ €์žฅํ•˜๋‹ค๊ฐ€ ๊ฐ‘์ž๊ธฐ ๊ถ๊ธˆํ•ด์กŒ๋‹ค. Shell์—์„œ๋„ ๋ณ€์ˆ˜์˜ ์ตœ๋Œ€ ํฌ๊ธฐ๊ฐ€ ์ •ํ•ด์ ธ ์žˆ์„๊นŒ?

๊ตฌ๊ธ€์— shell variable max size ๋ผ๊ณ  ๊ฒ€์ƒ‰ํ–ˆ๊ณ (์งง์€ ์˜์–ด ์‹ค๋ ฅ...), ์Šคํƒ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ์—์„œ ๋‹ต์„ ์ฐพ์•˜๋‹ค.

It depends on your OS and/or the shell flavours and versions. It is safer to use temporary files if you expect variable values to exceed 1-4kB.

 

๋Œ€์ถฉ ๋ฒˆ์—ญํ•˜์ž๋ฉด OS์™€ shell ๋ฒ„์ „์— ๋”ฐ๋ผ ๋‹ค๋ฅธ๋ฐ, ๋ณ€์ˆ˜์˜ ํฌ๊ธฐ๊ฐ€ 1-4kb๊ฐ€ ๋„˜๋Š”๋‹ค๋ฉด ์ž„์‹œ ํŒŒ์ผ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค๊ณ  ํ•œ๋‹ค.

 

 

Shell variable - of limited size?

Are shell variables limited in size? And which is the max size a variable can hold?

stackoverflow.com

 

๋ฐ˜์‘ํ˜•