공부
[sh] while loop (sub shell) not assign global variables -> for in loop
승가비
2023. 2. 16. 00:54
728x90
https://unix.stackexchange.com/questions/402750/modify-global-variable-in-while-loop
Modify global variable in while loop
I have a script that process a folder, and count the files in the mean time. i=1 find tmp -type f | while read x do i=$(($i + 1)) echo $i done echo $i However, $i is always 1, how do I res...
unix.stackexchange.com
https://skylit.tistory.com/321
Bash shell에서 for 루프 사용하기
OS: Ubuntu 16.04Shell: bash 배쉬(bash) 쉘에서 반복문, 즉 루프(loop)를 돌릴 때 여러가지 방법을 사용할 수 있다. 1. seq 사용 가장 간단한 방법이다. seq라는 프로세스가 순서대로 숫자를 출력해 주는 역할
skylit.tistory.com
728x90