"cd" command dont work in debug.cfg

hrust_ray

Neuer User
Mitglied seit
11 Jan 2007
Beiträge
133
Punkte für Reaktionen
0
Punkte
0
Hi.
Can it be some reason, that "cd" command cannot be executed in debug.cfg?
F.e.
"cd var"
says "cannot find path"
Maybe debug.cfg have no rights to change folder?
I have no other ideas:( . The same command work perfect in telnet
 
Try "cd /var".

Bye, Jojo
 
This what I tried:
my test.sh contains following code
Code:
set -x #schaltet debug mode an
sleep 5
chdir /var/media/
cd /var/media/

here is result in telnet:
Code:
# ./test.sh
+ sleep 5
BusyBox v1.1.2 (2006.11.23-09:19+0000) multi-call binary

Usage: sleep N

Pause for N seconds.

+ chdir /var/media/
./test.sh: chdir: 1: can't cd to /var/media/
+ cd /var/media/
./test.sh: cd: 1: can't cd to /var/media/
#

The same commands are executed without problems directly in telnet.
They are not working from script :(
 
And what about the following?
cd /var
pwd ( <- post output please)
cd media

Does "sleep 5" work correct on commandline ?
 
How and where was that script produced? Does it have UNIX or DOS format (LF or CR/LR) (hint: it should have UNIX format, LF only, no CR)
 
sleep works from command line - delay is ok.

Here is output for new try with pwd
Code:
# ./test2.sh
+ sleep 5
BusyBox v1.1.2 (2007.01.29-15:09+0000) multi-ca

Usage: sleep N

Pause for N seconds.

+ cd /var
./test2.sh: cd: 1: can't cd to /var
+ pwd
/var/media/ftp/MassStorageDevice-Partition-0-1
+ cd media
./test2.sh: cd: 1: can't cd to media
+ pwd
/var/media/ftp/MassStorageDevice-Partition-0-1
#
 
Great!!! Works finally :)))
Previous script I created in simple windows editor.
Now I try the same script, created with Uedit32 and save file in UNIX format - and it works!!!
Thanks for tipp!
 
I've just tested and can confirm that your symptoms are seen with DOS file format, CR and LF.
If you transfer that file to the box via FTP, use ASCII mode.
Or create it on the box e.g. with vi. Or if you can't cope with vi, use echo
Code:
echo "set -x" >test.sh
echo "sleep 5" >> test.sh
echo "cd /var/media" >> test.sh

EDIT: well you found out yourself meanwhile...

Bye, Jojo
 
Kostenlos!

Zurzeit aktive Besucher

Statistik des Forums

Themen
248,090
Beiträge
2,281,132
Mitglieder
377,285
Neuestes Mitglied
TheAbyss1980