beam/examples/beamsh: correctly parse nested commands
beam/examples/beamsh: correctly parse nested commands

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)

moxiegirl/swarm,mgoelzer/swarm,alexisbellido/docker.github.io,rajdeepd/swarm,anweiss/docker.github.io,menglingwei/denverdino.github.io,MHBauer/swarm,johnstep/docker.github.io,londoncalling/docker.github.io,tranceitionalMynd/swarm,everett-toews/swarm,zkcrescent/swarm,echupriyanov/swarm,aduermael/docker.github.io,docker/docker.github.io,kunalkushwaha/swarm,alexisbellido/docker.github.io,rillig/docker.github.io,rillig/docker.github.io,deis/swarm,deis/swarm,pssahi/swarm,CodeNow/swarm,londoncalling/docker.github.io,ricca742/swarm,parapsyche/swarm,auzias/swarm,joeuo/docker.github.io,aluzzardi/swarm,BSWANG/denverdino.github.io,bfirsh/swarm,docker/docker.github.io,ezrasilvera/SwarmACLs,affo/swarm,denverdino/denverdino.github.io,denverdino/docker.github.io,bsmr-docker/swarm,denverdino/swarm-1,everett-toews/swarm,mavenugo/swarm,shubheksha/docker.github.io,shot/swarm,vieux/swarm,joaofnfernandes/docker.github.io,denverdino/docker.github.io,ezrasilvera/SwarmACLs,dims/swarm,denverdino/docker.github.io,alexisbellido/docker.github.io,rutulpatel/swarm,shin-/docker.github.io,PeoplePerHour/libswarm,jimenez/swarm,mavenugo/swarm,bdwill/docker.github.io,qianzhangxa/swarm,BSWANG/denverdino.github.io,gdevillele/docker.github.io,jzwlqx/denverdino.github.io,cpuguy83/swarm,LuisBosquez/docker.github.io,yp-engineering/swarm,bpradipt/swarm,raoofm/swarm,resouer/swarm,gdevillele/docker.github.io,shin-/docker.github.io,SivagnanamCiena/swarm,xFragger/swarm,errordeveloper/swarm,Spritekin/swarm,LukasBacigal/swarm,jimmycmh/swarm,qianzhangxa/swarm,danix800/docker.github.io,shakamunyi/swarm,docker/docker.github.io,mgoelzer/swarm,allencloud/swarm,denverdino/docker.github.io,ezrasilvera/swarm,joeuo/docker.github.io,SivagnanamCiena/swarm,phiroict/docker,jimmycmh/swarm,iaintshine/swarm,joaofnfernandes/docker.github.io,affo/swarm,barais/swarm,fugr/swarm,atlassian/swarm,Spritekin/swarm,ealang/swarm,riuvshin/swarm,francisbouvier/swarm,schmunk42/swarm,auzias/swarm,aidora/pisces,xFragger/swarm,shin-/docker.github.io,kunalkushwaha/swarm,bsmr-docker/swarm,doronp/swarm,johnstep/docker.github.io,dnephin/swarm,denverdino/swarm,barais/swarm,shahankhatch/swarm,mrjana/swarm,francisbouvier/swarm,pssahi/swarm,pdevine/swarm,BSWANG/swarm,alexisbellido/docker.github.io,ejholmes/swarm,rav121/swarm,thaJeztah/docker.github.io,phiroict/docker,joeuo/docker.github.io,CiaranCostello/swarm,NunoEdgarGub1/swarm,jay-lau/swarm,tnachen/swarm,londoncalling/docker.github.io,LuisBosquez/docker.github.io,denverdino/docker.github.io,u2mejc/swarm,Aorjoa/swarm,docker/docker.github.io,gradywang/swarm,gdevillele/docker.github.io,christophelec/swarm,tnachen/swarm,linecheng/swarm,CodeNow/swarm,ehazlett/swarm,kyhavlov/swarm,shin-/docker.github.io,denverdino/swarm-1,shahankhatch/swarm,rancher/swarm,shot/swarm,ejholmes/swarm,adouang/swarm,anweiss/docker.github.io,beni55/swarm-1,rutulpatel/swarm,alexisbellido/docker.github.io,troy0820/docker.github.io,BSWANG/denverdino.github.io,swarm-hooks/swarm,marsmensch/swarm,joeuo/docker.github.io,cpuguy83/swarm,cgvarela/swarm,aluzzardi/swarm,polyverse-security/swarm,megamsys/swarm,abronan/swarm,troy0820/docker.github.io,EderRoger/swarm,adouang/swarm,sanscontext/docker.github.io,chanwit/swarm,gdevillele/docker.github.io,liubin/swarm,troy0820/docker.github.io,bdwill/docker.github.io,fugr/swarm,jdamick/swarm,snrism/swarm,linecheng/swarm,parapsyche/swarm,denverdino/denverdino.github.io,londoncalling/docker.github.io,vieux/swarm,jzwlqx/denverdino.github.io,jay-lau/swarm,shubheksha/docker.github.io,docker-zh/docker.github.io,christophelec/swarm,shubheksha/docker.github.io,thaJeztah/docker.github.io,docker-zh/docker.github.io,johnstep/docker.github.io,FreedomWangLi/swarm,abronan/swarm,LuisBosquez/docker.github.io,bfirsh/swarm,rancher/swarm,ch3lo/swarm,sfsmithcha/swarm,docker-zh/docker.github.io,cgvarela/swarm,JimGalasyn/docker.github.io,jimenez/swarm,jeffjen/swarm,aidora/pisces,FollowMyDev/swarm,beni55/swarm-1,therealbill/swarm,menglingwei/denverdino.github.io,chanwit/swarm,aduermael/docker.github.io,vlajos/swarm,sanscontext/docker.github.io,gonkulator/swarm,EderRoger/swarm,shakamunyi/swarm,akerbis/armhf-swarm,sanscontext/docker.github.io,jimmyxian/swarm,atlassian/swarm,srikalyan/swarm,morpheyesh/swarm,BSWANG/denverdino.github.io,gonkulator/swarm,shin-/docker.github.io,phiroict/docker,denverdino/denverdino.github.io,gradywang/swarm,danix800/docker.github.io,anweiss/docker.github.io,ealang/swarm,moxiegirl/swarm,krystism/swarm,unodba/swarm,PeoplePerHour/libswarm,rillig/docker.github.io,aduermael/docker.github.io,jeffjen/swarm,phiroict/docker,schmunk42/swarm,errordeveloper/swarm,LuisBosquez/docker.github.io,bpradipt/swarm,rajdeepd/swarm,bdwill/docker.github.io,jdamick/swarm,ezrasilvera/swarm,joaofnfernandes/docker.github.io,mrjana/swarm,swarm-hooks/swarm,shubheksha/docker.github.io,ricca742/swarm,mountkin/swarm,joaofnfernandes/docker.github.io,troy0820/docker.github.io,thaJeztah/docker.github.io,BSWANG/swarm,iaintshine/swarm,FreedomWangLi/swarm,jzwlqx/denverdino.github.io,NunoEdgarGub1/swarm,rav121/swarm,allencloud/swarm,bdwill/docker.github.io,JimGalasyn/docker.github.io,pdevine/swarm,rchicoli/swarm,sanscontext/docker.github.io,dnephin/swarm,phiroict/docker,anweiss/docker.github.io,ch3lo/swarm,therealbill/swarm,ehazlett/swarm,denverdino/denverdino.github.io,danix800/docker.github.io,krystism/swarm,Aorjoa/swarm,rillig/docker.github.io,bdwill/docker.github.io,jimmyxian/swarm,danix800/docker.github.io,JimGalasyn/docker.github.io,dims/swarm,sfsmithcha/swarm,megamsys/swarm,joeuo/docker.github.io,BSWANG/denverdino.github.io,anweiss/docker.github.io,docker-zh/docker.github.io,menglingwei/denverdino.github.io,zkcrescent/swarm,thaJeztah/docker.github.io,u2mejc/swarm,menglingwei/denverdino.github.io,srikalyan/swarm,rchicoli/swarm,tangkun75/swarm,menglingwei/denverdino.github.io,snrism/swarm,raoofm/swarm,joaofnfernandes/docker.github.io,echupriyanov/swarm,CiaranCostello/swarm,riuvshin/swarm,morpheyesh/swarm,marsmensch/swarm,johnstep/docker.github.io,mountkin/swarm,resouer/swarm,akerbis/armhf-swarm,LukasBacigal/swarm,jzwlqx/denverdino.github.io,johnstep/docker.github.io,FollowMyDev/swarm,kyhavlov/swarm,sanscontext/docker.github.io,gdevillele/docker.github.io,londoncalling/docker.github.io,tangkun75/swarm,docker-zh/docker.github.io,jzwlqx/denverdino.github.io,yp-engineering/swarm,MHBauer/swarm,polyverse-security/swarm,denverdino/denverdino.github.io,liubin/swarm,shubheksha/docker.github.io,thaJeztah/docker.github.io,JimGalasyn/docker.github.io,LuisBosquez/docker.github.io,denverdino/swarm,tranceitionalMynd/swarm,aduermael/docker.github.io,JimGalasyn/docker.github.io,unodba/swarm,docker/docker.github.io,doronp/swarm,vlajos/swarm