@wuschel The problem is, that your script has CR-LF line endings (DOS mode).
You need convert it to LF endings. You can use the dos2unix
helper to do so.
sudo apt-get install dos2unix
dos2unix uptime.sh
System Uptime shellsensor device
@wuschel The problem is, that your script has CR-LF line endings (DOS mode).
You need convert it to LF endings. You can use the dos2unix
helper to do so.
sudo apt-get install dos2unix
dos2unix uptime.sh
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig How has leader got the script to run? Or do you use “developer” all dos2unix?
@wuschel said in System Uptime shellsensor device:
How has leader got the script to run? Or do you use “developer” all dos2unix?
Well, it depends on how you create the file. It looks like your web browser is running on a windows system. If you create the file on the Windows system it will have the wrong line endings (CR-LF) unless you use a text editor which allows for setting the appropriate line endings for the target host (LF). Personally, I use kitty SSH (a putty derivative SSH client) to login into the Linux host. This way, I can copy-paste content between Windows and Linux hosts while the terminal emulation takes care of the conversion of line endings.
Btw, if you search the forum for dos2unix you’ll realize this is a common problem.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
as marcus said, if you do a copy / paste from a browser it could be that there are hidden characters or linefeeds etc. these can be cut off by using dos2unix.
i am running a windows machine and work with notepad++
this program has a built in ftp so that i am copying my codework directly from notepad++ to the linux pi.
so i am not having the problem with CR/LF and so on.
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
@wuschel For future posts containing code snippets or command transcripts please take the following into account. Thanks
https://forum.pimatic.org/topic/1179/how-to-post-code-snippets-and-alike-on-the-forum
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig said in System Uptime shellsensor device:
@wuschel For future posts containing code snippets or command transcripts please take the following into account. Thanks
https://forum.pimatic.org/topic/1179/how-to-post-code-snippets-and-alike-on-the-forum
i will try it