bash - Maximum nested function level reached -


I have a directory hierarchy where the "root" directory contains a file named "text.txt". I want to search this "root" directory and since then it runs the command 'foo'. Here's what I currently have

  # root directory detects root () {local root #Findup directory looks through directory hierarchy I'm sure it works Root = $ (Research text 2 text & gt; & amp; / dev / null) If [[$? -a 0]] To resonate "Root Not Found" to resonate 1EF echo root # Root directory runFoo () {foo push $ myDir 1 & gt; from inside local myDir myDir = $ (locateRoot) & Amp; / Dev / null foo $ @ popd 1 & gt; & Amp; However, whenever I run this program I:  
  reached the maximum nested function level  

/ Pre>

What's wrong with me? I hope foo works is positive.

In the locateRoot function you just echo Only the content of root , which is incorrect and your script seems too long to do some simple tasks. I give you a sample script which prints the path to the directory that contains the text.txt file

  #! / Bin / bash locateRoot () {var = $ (/ / -iname "text.txt") Print "% s \ n" "$ var"}  

You can see the complete path in that file. You can execute your command like the script

  cd $ var / //. Code> 

Comments

Popular posts from this blog

eclipse plugin - Run java code error: Workspace is closed -

ios - How do I use CFArrayRef in Swift? -

scala - Play Framework - how to bind form to a session field -