chd.sh
#! /bin/bash
cd django/hellodjango
exec bash
python manage.py runserver
chd.py
# a=`python chd.py`;cd $a
import os
new_dir = "django/hellodjango"
os.chdir(new_dir)
are the two ways I have tried. Also, on terminal I have tried,
. chd.sh
./chd.sh
. ./chd.sh
I have also tried to assign to variable and then run on terminal but no success. Spent over 4 hours trying multiple methods given on stackoverflow.com but no success yet. The only thing that has worked yet is,
alias mycd='cd django/hellodjango'
But I will have to copy paste it everytime.
alias myrun = `cd django/hellodjango && python manage.py runserver`
And,
alias myrun = `cd django/hellodjango; python manage.py runserver`
doesn't work. This is just a sample, there are so many django commands that I have to use repeatedly. Appreciate if you have read all this way. If you know the link where this is discussed, please attach the link, as I was not able to find after hours of search. Edit:
/storage/emulated/0 $
This is what the prompt appears like.
/storage/emulated/0/django/hellodjango
This is the path.
/storage/emulated/0 $ cd django/hellodjango
/storage/emulated/0/django/hellodjango $ python manage.py
runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
July 25, 2020 - 19:08:42
Django version 3.0.7, using settings 'hellodjango.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Individually works fine.
Edit:
/storage/emulated/0 $ chmod u+x chd.sh /storage/emulated/0 $ chmod u+x rn.sh /storage/emulated/0 $ ./chd.sh ./chd.sh: cd: line 2: can't cd t: No such file or directory /storage/emulated/0 $ chmod u+x chd.py /storage/emulated/0 $ a=
python chd.py
;cd $a ~/data/ru.iiec.pydroid3/app_HOME $
Edit:
/data/user/0/tech.ula/files/support/dbclient: Caution, skipping hostkey check for localhost
subham@localhost's password: subham@localhost:~$ ls subham@localhost:~$ cd subham@localhost:~$ pwd /home/subham subham@localhost:~$ pkg install miniconda
-bash: pkg: command not found subham@localhost:~$ apt install miniconda Reading package lists... Done Building dependency tree Reading state information... Done
E: Unable to locate package miniconda subham@localhost:~$
subham@localhost:~$ cd .. subham@localhost:/home$ cd .. subham@localhost:/$ ls
bin dev host-rootfs mnt root srv
sys var boot etc lib opt run storage tmp data home media proc sbin support usr subham@localhost:/$ cd ..
subham@localhost:/$ cd sys subham@localhost:/sys$ ls
ls: cannot open directory '.': Permission denied
subham@localhost:/sys$ cd..
-bash: cd..: command not found subham@localhost:/sys$ cd ..
subham@localhost:/$ cd storage
subham@localhost:/storage$ ls internal subham@localhost:/storage$ cd internal subham@localhost:/storage/internal$ ls subham@localhost:/storage/internal$ ls -l total 0 subham@localhost:/storage/internal$ cd 0
-bash: cd: 0: No such file or directory subham@localhost:/storage/internal$
subham@localhost:/$ chmod -R 777 /host-rootfs
chmod: changing permissions of '/host-rootfs': Read-only file system
chmod: cannot read directory '/host-rootfs': Permission denied
subham@localhost:/$