Click here to Skip to main content
15,442,754 members

Comments by Bryan Woodruff (Top 10 by date)

Bryan Woodruff 12-May-22 11:04am View    
ok thank you
Bryan Woodruff 12-May-22 10:24am View    
Hello I appreciate your time in trying to help me solve my problem. I changed my code to try "let" this time. I am still getting -3 for my the time it took to run the program. Also I am using bash. I might be explaining my problem badly, I dont normally post on here I usually try to figure it out myself.
Bryan Woodruff 12-May-22 10:22am View    
Hey Richard I updated the code to what I have wrote in all. Sorry I dont normally post on here I usually try to figure it out myself. Also I am feeding it a command line input called ./lab10.sh 10
Bryan Woodruff 12-May-22 8:49am View     CRLF
Hello Richard, Sorry for not being more specific on my question, I am trying to access the elapsed variable inside the recur_fib() function so I can get the time it takes for the function to calculate. When I try to access it how I have it now "total_time=$(recur_fib $elapsed)" it gives me -3. Which can't be right since it I am looking for the time it took to complete which should be positive. As to the line 20 error, line 20 is "[ $first_num -lt 2 ] && echo -n $first_num || echo -n $(( $( recur_fib $(( first_num - 1 )) ) + $( recur_fib $(( first_num - 2 )) ) ))" Hopefully you can give some assistance to where I am going wrong. I also tried the export command inside the function but that didn't work.
Bryan Woodruff 11-Dec-21 17:24pm View    
You're 100% Luc I should research more and I guess the past couple videos I have been watching in order to learn weren't the greatest Thank you for your time you we're really helpful. I have been trying to teach myself php and mysql for my final project and since the class I am in for school isn't the greatest. I dont know if you have any recommended resources but in the mean Ill try to find better ones. H