sub shell problem in bash scripting
pls tell me how to return controll to parent process in bash scripting
my code was #!/bin/bash global_i=0 global_j=0 while ((i<100)) do ( while ((j<100)) do `mkdir "shiv$i$j` let j=j+1 done ) i=i+1 done when i ran this script every thing was working fine i mean to say that 100*100 folders were making in the folder in which script is running... but the problem is that when i check for pid from other terminal there are only two processes one for parent process and other is of subshell... but i do wanna 100 sub shells... how to do this pls help me... |
Can you tell us what your overall goal is?
The `mkdir "shiv$i$j` part is executed one at the time. There will only be 2 shells (the script itself and the mkdir sub-shell) at the time. The back-ticks aren't needed for this script to make it work. But then again, maybe you want to accomplish something that isn't clear (to me). |
going off your two posts you seem to be confused with what the backticks are actually for
often they are used to 'capture' the output of a command for example, to 'store' the date Code:
DateAndTime=`date` Code:
DateAndTime=$(date) for more details on to your script, Code:
#!/bin/bash the use of {} in ${i} ${j} allows for the _, example shiv$i_$j would give shiv_001 , since $i_ does not exist |
Quote:
Either you are confused in how the control works or you should tell us what you are exactly trying to do ? |
All times are GMT -5. The time now is 08:52 AM. |