I have a script called "test" on a remote server's home folder that contains the following lines:
#!/bin/bash
tengbe=`ifconfig | grep -B1 192.168 | awk 'NR==1 { print $1 }' | sed 's/://g'`
Basically, it just stores the name of the interface of the local server into a variable once the script is called. When I ssh into the remote server to call the script, I get an error:
ssh remoteserver-IP './test'
./test: line 3: ifconfig: command not found
What might be wrong with my script? I have seen various answers that does not offer a solution to my issue.