While learning about/customizing my GCP Cloud Shell startup environment I inadvertently added an 'exit' in my .bashrc and now cannot even get the shell up long enough to reset it when I click on the Cloud Shell icon from GCP dashboard -- how to reset it now? I really can't do anything to fix as Cloud Shell exits immediately trying to start up.
Asked
Active
Viewed 254 times
0
-
Is it possible to use ssh to move it out of the way; maybe something like `ssh server mv .bashrc .bashrc.dontuse`. – Rudedog Jul 29 '19 at 21:24
3 Answers
0
You can use gcloud alpha cloud-shell ssh
with the option --command
to rename the file as suggested in the comments to the question, or to simply sed
that line out of existence.

Jofre
- 3,718
- 1
- 23
- 31
-2
OK, I fixed it. Solution is to click very quickly on the 'Editor' icon in top right of initial Cloud Shell window when it tries to open giving you a file list of your home directory which is stable and will stay open. Then go to 'Edit', 'Find in Files' and, in my case, search for 'exit'. But to find in hidden files such as .bashrc you need also to click the little eye icon to 'Include Ignored Files'. Edit, exit and restart a Cloud Shell instance and you're good.