This page last changed on Mar 15, 2014 by icefluffy.
I'm trying to add 2 numeric variables in a script running on my Synology NAS.
I can't seem to get it working:
This code just doesn't make the sum of the variables!!
Anyone have any ideas please?
It does work on my Synology DS1512+ with DSM 4.3
Posted by aktur at Mar 16, 2014 10:06
I have a DS213+ with DSM4.3, maybe it has something to do with that...
Posted by icefluffy at Mar 16, 2014 14:15
With Putty the sh does work on my DS212+ console:
Posted by pz1 at Mar 16, 2014 16:11
+1394987224tPhone.sh: line 5: syntax error: 10
Posted by icefluffy at Mar 16, 2014 16:28
With which shell you are calling it? I've tried it with /bin/sh and /opt/bin/bash. Both give the correct answer.
Posted by aktur at Mar 16, 2014 16:56
I've tried both...
Posted by icefluffy at Mar 16, 2014 17:29
To be complete:
Using vi I made test.sh
chmod +x test.sh
Posted by pz1 at Mar 16, 2014 17:33
trying this didn't help either :
Re: bash as shell and MC with subshell toggle
Postby johnk.dev.null » Tue Sep 03, 2013 6:23 pm
What maxxfi said is important ... so ...
Keep /bin/ash as your root shell and in /root/.profile add these lines at the end -
Code: Select all
if [[ -x /opt/bin/bash ]]; then
This gives you a bash root shell with no risk when upgrading DSM or if you lose /opt.
Next create /root/.bashrc and add these lines -
Code: Select all
PS1='\u@\h:\w \$ '
The first line gives you a nice bash prompt. The second explicitly sets the SHELL variable to your correct shell. Ctl+O now works once you have logged out and back in again.
As always when changing root shell settings, keep a separate root shell window open until you have confirmed all of the changes work.
I'm giving up for tonight I think...
Posted by icefluffy at Mar 16, 2014 18:36