Error with .sh within .sh called thru WinSCP

Advertisement

sheauyun
Joined:
Posts:
12

Error with .sh within .sh called thru WinSCP

Hi,

I had being using WinSCP for quite a long while and it is awesome. Until recently I bumped into problem calling a .sh that throwing error when I run it with WinSCP. I don't see same problem if I try to run it on Terminal.
So, wondering how could I fix that.

I am calling nvwp.sh from WinSCP and this works fine. But, the nvwp.sh had called some executable in /usr/sbin/ can caused problem: (i2cget is the file located in /usr/sbin)

< 2015-08-20 09:55:57.781 Script: /opt/usr/sbin/nvwp.sh: line 31: i2cget: command not found
! 2015-08-20 09:55:57.781 /opt/usr/sbin/nvwp.sh: line 31: i2cget: command not found

I try to call cd /usr/sbin before calling /opt/usr/sbin/nvwp.sh hoping that it would temporarily solve my problem but it did not.
I don't need to stay in /usr/sbin to get things work without need to change the .sh file.

Thanks.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,271
Location:
Prague, Czechia

Re: Error with .sh within .sh called thru WinSCP

WinSCP (and Plink) uses (have to) non-interactive terminal.

So different set of startup scripts (or different branches in startup scripts) are executed. What possibly results in different search paths (PATH) being set.

Fix your startup scripts to set the same PATH for both interactive and non-interactive sessions.

Reply with quote

Advertisement

You can post new topics in this forum