SH file under Windows Ubuntu - Change directory not working

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I created a test.sh file and tried to run sudo ./test.sh



In that SH file, CD does not work, not able to find path. CD to a mounted drive like CD /mnt/e/myfolder/myfolder1



I am running Ubuntu inside Windows.







share|improve this question

















  • 2




    do you had add permissions to you bash file?
    – damadam
    Jun 11 at 14:15






  • 4




    Do cat -A on the script file, see if it's saved with Windows line ending. Common problem, rule this out first
    – Sergiy Kolodyazhnyy
    Jun 11 at 14:16










  • Do you mean CD or rather cd?
    – muclux
    Jun 11 at 16:36






  • 1




    Please edit your question to add the full error message, and the whole script (or at least the line that doesn't work).
    – wjandrea
    Jun 11 at 16:44






  • 1




    You'll probably want to avoid using sudo until you can debug the script.
    – wjandrea
    Jun 11 at 16:45














up vote
0
down vote

favorite












I created a test.sh file and tried to run sudo ./test.sh



In that SH file, CD does not work, not able to find path. CD to a mounted drive like CD /mnt/e/myfolder/myfolder1



I am running Ubuntu inside Windows.







share|improve this question

















  • 2




    do you had add permissions to you bash file?
    – damadam
    Jun 11 at 14:15






  • 4




    Do cat -A on the script file, see if it's saved with Windows line ending. Common problem, rule this out first
    – Sergiy Kolodyazhnyy
    Jun 11 at 14:16










  • Do you mean CD or rather cd?
    – muclux
    Jun 11 at 16:36






  • 1




    Please edit your question to add the full error message, and the whole script (or at least the line that doesn't work).
    – wjandrea
    Jun 11 at 16:44






  • 1




    You'll probably want to avoid using sudo until you can debug the script.
    – wjandrea
    Jun 11 at 16:45












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I created a test.sh file and tried to run sudo ./test.sh



In that SH file, CD does not work, not able to find path. CD to a mounted drive like CD /mnt/e/myfolder/myfolder1



I am running Ubuntu inside Windows.







share|improve this question













I created a test.sh file and tried to run sudo ./test.sh



In that SH file, CD does not work, not able to find path. CD to a mounted drive like CD /mnt/e/myfolder/myfolder1



I am running Ubuntu inside Windows.









share|improve this question












share|improve this question




share|improve this question








edited Jun 11 at 14:18









Byte Commander

57.8k26155263




57.8k26155263









asked Jun 11 at 14:13









Yen Dutt Jain

1




1







  • 2




    do you had add permissions to you bash file?
    – damadam
    Jun 11 at 14:15






  • 4




    Do cat -A on the script file, see if it's saved with Windows line ending. Common problem, rule this out first
    – Sergiy Kolodyazhnyy
    Jun 11 at 14:16










  • Do you mean CD or rather cd?
    – muclux
    Jun 11 at 16:36






  • 1




    Please edit your question to add the full error message, and the whole script (or at least the line that doesn't work).
    – wjandrea
    Jun 11 at 16:44






  • 1




    You'll probably want to avoid using sudo until you can debug the script.
    – wjandrea
    Jun 11 at 16:45












  • 2




    do you had add permissions to you bash file?
    – damadam
    Jun 11 at 14:15






  • 4




    Do cat -A on the script file, see if it's saved with Windows line ending. Common problem, rule this out first
    – Sergiy Kolodyazhnyy
    Jun 11 at 14:16










  • Do you mean CD or rather cd?
    – muclux
    Jun 11 at 16:36






  • 1




    Please edit your question to add the full error message, and the whole script (or at least the line that doesn't work).
    – wjandrea
    Jun 11 at 16:44






  • 1




    You'll probably want to avoid using sudo until you can debug the script.
    – wjandrea
    Jun 11 at 16:45







2




2




do you had add permissions to you bash file?
– damadam
Jun 11 at 14:15




do you had add permissions to you bash file?
– damadam
Jun 11 at 14:15




4




4




Do cat -A on the script file, see if it's saved with Windows line ending. Common problem, rule this out first
– Sergiy Kolodyazhnyy
Jun 11 at 14:16




Do cat -A on the script file, see if it's saved with Windows line ending. Common problem, rule this out first
– Sergiy Kolodyazhnyy
Jun 11 at 14:16












Do you mean CD or rather cd?
– muclux
Jun 11 at 16:36




Do you mean CD or rather cd?
– muclux
Jun 11 at 16:36




1




1




Please edit your question to add the full error message, and the whole script (or at least the line that doesn't work).
– wjandrea
Jun 11 at 16:44




Please edit your question to add the full error message, and the whole script (or at least the line that doesn't work).
– wjandrea
Jun 11 at 16:44




1




1




You'll probably want to avoid using sudo until you can debug the script.
– wjandrea
Jun 11 at 16:45




You'll probably want to avoid using sudo until you can debug the script.
– wjandrea
Jun 11 at 16:45















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045629%2fsh-file-under-windows-ubuntu-change-directory-not-working%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045629%2fsh-file-under-windows-ubuntu-change-directory-not-working%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491