-1

I am new to bash. I wanted to know how can i "cd" to a partial path in a shell script.

The path i want to cd to in my script is C:\Users\abcxyz\Documents\Projects\BD Work\Log2time\Final\Menu testing\Do_not_modify_files\All_Artifacts I want to cd to:

 cd *\Do_not_modify_files\All_Artifacts

if i pwd after cd C:/Users/abcxyz/Documents/Projects/BD Work/Log2time/Final/Menu testing/Do_not_modify_files/All_Artifacts - i can see the files.But

if i do pwd after cd */Menu testing/Do_not_modify_files/All_Artifacts error is - No such file or directory

Shalabh
  • 27
  • 4
  • What do you think that `cd */Menu testing/Do_not_modify_files/All_Artifacts` actually means? (Hints: what does `*` expand to? Won't the space between `Menu` and `testing` separate two arguments?) – AlexP Oct 24 '19 at 13:47
  • For the spacing between menu and testing,i already added double quotes. Sorry i am new to bash but how can i cd to " *\Do_not_modify_files\All_Artifacts". where * can be anything? – Shalabh Oct 24 '19 at 13:50
  • You can change directory into only one directory at one time... So you must decide what exactly it is which you want to do. Find one directory named `All_Artifacts` at random in your system and `cd` into it? Find them all and do something in each of them? What happens if your system doesn't actually have anywhere a directory named `All_Artifacts`? – AlexP Oct 24 '19 at 14:02

1 Answers1

0

This worked - cd ./Do_not_modify_files\All_Artifacts

Shalabh
  • 27
  • 4