Skip to main content
Became Hot Network Question
grammar spelling etc
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 67
  • 115

I have a raspberry pi that I connected to my home network, but each time I reboot it the last numberIP address changes of value, so instead. Instead of calling ssh user@ipadresuser@ipaddress each time, I want to run a bash script to know which is the final numberaddress that works.

I'm trying to run ssh user@ipadressuser@ipaddress several times changing the last number of the ipIP address. I don't know how bash works, so I attempted to make a file .sh to do it:

for i in {1..100}  do   call=`ssh [email protected].$i`   if [['$call'==*'user'*]]; then   echo "$i"   else   :   fi  done 

My problems are:

  • I don't print anything
  • It stucksis stuck in the first call and it doesn't make the loop

So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.

I have a raspberry pi that I connected to my home network, but each time I reboot it the last number changes of value, so instead of calling ssh user@ipadres each time, I want to run a bash script to know which is the final number that works.

I'm trying to run ssh user@ipadress several times changing the last number of the ip address. I don't know how bash works, so I attempted to make a file .sh to do it:

for i in {1..100}  do   call=`ssh [email protected].$i`   if [['$call'==*'user'*]]; then   echo "$i"   else   :   fi  done 

My problems are:

  • I don't print anything
  • It stucks in the first call and it doesn't make the loop

So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.

I have a raspberry pi that I connected to my home network, but each time I reboot it the IP address changes. Instead of calling ssh user@ipaddress each time, I want to run a bash script to know which is the address that works.

I'm trying to run ssh user@ipaddress several times changing the last number of the IP address. I don't know how bash works, so I attempted to make a file .sh to do it:

for i in {1..100} do call=`ssh [email protected].$i` if [['$call'==*'user'*]]; then echo "$i" else : fi done 

My problems are:

  • I don't print anything
  • It is stuck in the first call and it doesn't make the loop

So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.

added 247 characters in body
Source Link
terdon
  • 252.9k
  • 69
  • 481
  • 720

I have a raspberry pi that I connected to my home network, but each time I reboot it the last number changes of value, so instead of calling ssh user@ipadres each time, I want to run a bash script to know which is the final number that works.

I'm trying to run ssh user@ipadress several times changing the last number of the ip address. I don't know how bash works, so I attempted to make a file .sh to do it:

for i in {1..100} do call=`ssh [email protected].$i` if [['$call'==*'user'*]]; then echo "$i" else : fi done 

My problems are:

  • I don't print anything
  • It stucks in the first call and it doesn't make the loop

So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.

I'm trying to run ssh user@ipadress several times changing the last number of the ip address. I don't know how bash works, so I attempted to make a file .sh to do it:

for i in {1..100} do call=`ssh [email protected].$i` if [['$call'==*'user'*]]; then echo "$i" else : fi done 

My problems are:

  • I don't print anything
  • It stucks in the first call and it doesn't make the loop

So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.

I have a raspberry pi that I connected to my home network, but each time I reboot it the last number changes of value, so instead of calling ssh user@ipadres each time, I want to run a bash script to know which is the final number that works.

I'm trying to run ssh user@ipadress several times changing the last number of the ip address. I don't know how bash works, so I attempted to make a file .sh to do it:

for i in {1..100} do call=`ssh [email protected].$i` if [['$call'==*'user'*]]; then echo "$i" else : fi done 

My problems are:

  • I don't print anything
  • It stucks in the first call and it doesn't make the loop

So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.

deleted 2 characters in body
Source Link
iam_agf
  • 123
  • 1
  • 7

I'm trying to find my computer usingrun ssh $user@$ipadressuser@ipadress several times changing the last number of the ip address. I run adon't know how bash script from other computer but I'm having some issues. Here is the codeworks, so I attempted to make a file .sh to do it:

for i in {1..100} do call=`ssh [email protected].1.$i` if [['$call'==*'user'*]]; then echo "$i" else : fi done 

My problems are:

  • I don't print anything
  • It stucks in the first call and it doesn't make the loop

So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.

I'm trying to find my computer using ssh $user@$ipadress. I run a bash script from other computer but I'm having some issues. Here is the code:

for i in {1..100} do call=`ssh [email protected].1.$i` if [['$call'==*'user'*]]; then echo "$i" else : fi done 

My problems are:

  • I don't print anything
  • It stucks in the first call and it doesn't make the loop

So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.

I'm trying to run ssh user@ipadress several times changing the last number of the ip address. I don't know how bash works, so I attempted to make a file .sh to do it:

for i in {1..100} do call=`ssh [email protected].$i` if [['$call'==*'user'*]]; then echo "$i" else : fi done 

My problems are:

  • I don't print anything
  • It stucks in the first call and it doesn't make the loop

So I want to know if there is a bash function to pass over a command when it's another device, because I know the name of my user and I only need to find my user name in the command output of the first line, and don't need to wait for more output.

Source Link
iam_agf
  • 123
  • 1
  • 7
Loading