I'm very new to bash and Linux and I was wondering how I could make a bash loop so that when it runs, it will ask you how many times to run, and it will run that many times.
I did it in LUA but I want it to be in bash so it can be added to the
~/.bashrc file so it starts when I connect to my VPS via ssh. Here is the lua code I wrote:
write("How many times should I loop? ") local Num = tonumber( read() ) for i=1,Num do print("Looped "..tostring(i).." time(s).") end
Here is the little thing I will add to my
if [[ -n $SSH_CONNECTION ]] ; then echo example fi