grub, ok, bash, edit, kmdb and what else?


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers grub, ok, bash, edit, kmdb and what else?
# 1  
Old 07-21-2010
grub, ok, bash, edit, kmdb and what else?

Hello

There is a > prompt at Grub, # prompt for the console and $ for bash, but I am clueless about when and how to get into a specific prompt, how to move around between one prompt to another and how to exit.

Is there a very basic guide anywhere that CLEARLY explains the type of shell prompts? Or, would someone here be kind enough to explain it here?

Thank you.
# 2  
Old 08-12-2010
Specific prompts would only indicate what are you running on or where you are. You've given the examples quite well : for example, however, the $ sign doesn't necessarily means bash, because the prompt itself can be modified to end with #. This can be achieved by modifying the PS1 variable in your respective shell profile file. I can't tell for other shells, but if you are in doubt just execute :
Code:
echo $SHELL

to understand what shell you are running on. For the rest of the questions - it will depend on what you are trying to achieve, jumping from shell to shell is not exactly usual, unless you work in multi-shell and multi-user environment.
# 3  
Old 08-12-2010
Dear Sysgate

Thank you for your response.

A very old linux book, linux in easy steps explains one of the modes very well:


"... the vi editor has one of the most bizarre and seemingly non-user-friendly interfaces ever invented... The first, and most important thing to learn about vi is that it has two modes. When you are in input mode, everything you type goes to the screen, and into the file you are editing. (the only exceptions to this are the curson-movement commands and the exit from input mode command) When you are in command mode, nothing you type goes into the file you are editing.; rather it will be interpreted as a command to the editor to do something. Understanding this is the key to understanding vi

An example

1. Start a new file called "testfile"

vi testfile

2. Press "i" to enter input mode. Type some text and press ESC

hello this is vi |

3. You are in command mode. Press O and the cursor will return to the beginning of the line. Press "x" 5 times and on each stroke on eletter of the Ist word will be deleted.

4. Now press ":" A colon prompt will appear on the bottom line. You are now in command of every mode. Type "q!" and press RETURN. This will quit vi without saving and return to you to the shell prompt (This has been one of the greatest mysteries. I used to get stuck in the vi prompt and it seemed impossible to get out of the vi prompt unlesss I shut down and restarted the computer !

The author goes on to present some useful commands and colon commands:

i Insert before the character the cursor is on etc

Cursor Movement

G Go to the last line of the file etc

Miscellaneous Commands

J join the current line to the next one etc.

Getting out of vi

:wq write file, then quit etc


Other colon commands:

:sh Run a temporary shell (CNTL-D to return)

Is there anything like this in the man pages or elsewhere that LISTS and explains various command modes?


Thank You.
Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - add/edit to file and save - sed?

I'm working on a script to execute a number of items. One being, editing particular files to add certain lines. I'm attempting to utilize sed, but, having issues when running from a bash script. Assistance is greatly appreciated. My example: sed -i '14 i\ # add these lines add these lines to... (5 Replies)
Discussion started by: Nvizn
5 Replies

2. Shell Programming and Scripting

Plus edit and edit header

Dear Masters, i have a problem with unix script, till now i just know about how to create header. i want to change file below -63395.2 72653.5 -63361.3 72696.0 ... (9 Replies)
Discussion started by: ipatah
9 Replies

3. UNIX for Dummies Questions & Answers

"/boot/grub/grub.conf" VS "/etc/grub.conf"

can someone please explain me the difference between these two files: "/boot/grub/grub.conf" and "/etc/grub.conf" .. (7 Replies)
Discussion started by: stunn3r
7 Replies

4. Shell Programming and Scripting

scan and edit in bash

so assume I have a dozen files in local directory and half of them are .txt and I only want to scan these text files and go inside each of them and replace absolute paths (e.g. C:\blabla\more blahblah\myfile.txt) with just the name of that file (myfile.txt) and then go to next line and look if... (6 Replies)
Discussion started by: Jaymz
6 Replies

5. Red Hat

Can we specify which grub.conf to use in grub-install.

Hi, Can we specify which grub.conf to use while installing grub on RHEL. We are working on application which requires different grub configurations needed, depending on certain criteria we need to update grub with correct grub.conf. Can we use grub-install for this purpose? (4 Replies)
Discussion started by: successlin
4 Replies

6. Shell Programming and Scripting

Edit csv file with bash

I' trying to use bash to edit a csv file from this format: "apples","oranges","grapes" "bread","butter","milk" To this: "apples oranges grapes" So that if I would open the csv file in open office, "apples oranges grapes" Would be in one single cell, and "bread (2 Replies)
Discussion started by: locoroco
2 Replies

7. Shell Programming and Scripting

In bash, read to a variable with a default value to edit

My script needs to read a variable from the user. But before the user types the input, I want to give a default value so the user can edit the default value for input. How can I implement it? My script is something like: #!/bin/sh read -p 'Port number: ' -e port_number echo "Port... (7 Replies)
Discussion started by: pankai
7 Replies

8. Linux

Edit Grub? help!

Please help! I have installed 5 Linux OS in the following order: 1st : OpenSUSE 11.0 2nd : Ubuntu 8.4 3rd : Ubuntu 8.10 4th : OpenSUSE 11.1 5th : Fedora 10 Here is the scenario, at the 4th installation i can still choose which OS to boot as what OpenSUSE grub displays. Now, after... (3 Replies)
Discussion started by: etcpasswd
3 Replies

9. Red Hat

how to edit the bash shell?

Hello friends, I want to add some features to the bash shell.I logged in as the root.Even then could not view the source code of bash shell in RH 9,Fedora 8.It is in encrypted form.Can you please tell me how to include my code into bash shell. Please give me a sample code so that I can understand... (3 Replies)
Discussion started by: nsharath
3 Replies

10. UNIX for Dummies Questions & Answers

grub problem- keeps rebooting as soon as it tries to do grub

Hi, I installed solaris 10 a few weeks ago. It was working fine during the past two weeks. However, now when I start to load to the drive, I get this problem: The BIOS screen comes up like normal, then screen goes blank and a message "Grub loading stage 2" flashes real quick then the computer... (1 Reply)
Discussion started by: moesays
1 Replies
Login or Register to Ask a Question