Hey!
I have been making this Bash script for installing programs on slackware (slackbuilds and by slackpkg) but I have a problem.
here's the source code on pastebin:
http://pastebin.com/SJPkhhhA
(It's written in spanish ,I hope it's not a problem)
Well, if you execute the script you'll see an improvise head and 2 options, only consider the first one, which is meant to install slackbuilds.
if you see, I have put all the functions together on an exclusive section for them, the problem is on the function named "sel_directorio" (line 24) basically what I'm trying to do is to make the user write the name of the folder and when it's on the folder where the source code is located type 0 for escaping the loop and copy it.
The problem is that when I get to the point where I have to write the folder's name for the first time, it works, but when i try to enter to a folder inside the first one it doesn't work, cause this line:
Quote:
printf "\n\n Escriba nombres de directorios, al llegar al que está el código de fuente, presione 0: "
read DIRECTORIO
cd ~/$DIRECTORIO
|
it tries to search that folder again on home/user instead of "staying" in the last input folder and looking for the other one in it (subfolder).
also if you look on the function named "implicar", "sel_directorio" is called from there two times, in order to go from directory to directory (that's why I use 0 for "escaping"that loop, once source code found).
So, the question is, how can I make the function "sel_directorio" go through directories (and if you culd tell me also how to make a loop until an existent directory is typed, it would be really kind).
Thanks in advance