Jump to content

Change hostname


LLfan

Recommended Posts

I put it in red for you below:# .bashrc# User specific aliases and functions PS1="[\u:\w]$ "# Source global definitionsif [ -f /etc/bashrc ]; then . /etc/bashrcfi

Edited by teacher
Link to comment
Share on other sites

Yes. When you are fresh and alert on another day go back in and try the test file again. Remember that if it closes out after you do the Escape and then the ZZ then it worked. It takes you back out of vi and then all you have to do is Control D twice to take you out of the console. We will check to make sure after the escape it no longer shows insert at the bottom and then that it changes at the bottom after each capital Z.Did you see where I had left out the " at the end of the line and had to edit it? Did you get it right? Does your prompt say what you want it to say now? Tomorrow we will go back and look at lessons in vi!

Link to comment
Share on other sites

I don't know whether this will make any difference but when I save files in vi, I hit <ESC> and then type::wqI had never heard of using ZZ before but I tried it, too, and it works. Nice to know more than one way to do something! :) I wonder though if ZZ is an extension to vi that only exists in vim. Vi is normally link to vim in modern distros.In any case, it can't hurt to try <ESC>:wq and see what happens.

Link to comment
Share on other sites

Hi Jason,Indeed :wq or even :wq! are the other ways to save and close vi . . . . I just find ZZ so much easier and quicker . . ;) . . We will have to make a beginners guide/excersise for vi, because I´m not a real fan of editing in kwrite and the new members should have a good way to learn.Hi MikeMan, what an adventure ! . . . is your prompt now:[mike:~]$or do you still have ¨root¨ in there ? I´m asking this because your prompt did look very strange to start with, the hostname was very unusual and you did have some funny ¨start¨ problems for your home directory a few theads ago . . . so there might be a deeper problem with your system.I will put together a better vi-excercise during the day. Vi is very important for editing, this time you came away lightly because it was a file with ¨user-permissions¨ and it contained only a few short lines . . . using this technique on larger files with root-permissions will run you into problems for sure in the long run.I´ll get back to you !:teehee: Bruno

Link to comment
Share on other sites

I will put together a better vi-excercise during the day. Vi is very important for editing, this time you came away lightly because it was a file with ¨user-permissions¨ and it contained only a few short lines . . . using this technique on larger files with root-permissions will run you into problems for sure in the long run.
Rute pointed me to "vimtutor". A worthwhile exercise. Teachs by doing.I found this to be a usefull help for Vim.Still not sure what my development editor will be but decided early that Vim was the portable editor. No matter which distribution I was using, I would have vi/vim.
Link to comment
Share on other sites

OwynGreat links. I tend to forget that Rute is anything other than a paperback book. It is my main resource book. Great tutorial. MikeThere is your homework assignment. Go for it!

Link to comment
Share on other sites

Rute pointed me to "vimtutor". A worthwhile exercise. Teachs by doing.I found this to be a usefull help for Vim.Still not sure what my development editor will be but decided early that Vim was the portable editor. No matter which distribution I was using, I would have vi/vim.
Owyn, I could not agree with you more !! Thanks for posting these links . . . Could you do me the pleasure to post an exact copy of this post in the thread I will post myself a little later called ¨Vi-exercise¨ ?? Vi is indeed a magical editor, with all kind of extra´s. I like the syntax highlighting and intuitive editing for scripts. Have a look here how you tweak your vi with line-numbering and other nice and absolutely needed extra´s. Vi rulez ! :teehee: ;) Bruno
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...