Vi editor questions

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Vi editor questions
# 1  
Old 03-30-2013
Vi editor questions

Code:
1. How do you do the following? 
a) invert the case of all characters in the correct line
b) convert to uppercase the entire line

2. How can you number all the lines which are a) saved, b) not saved, when saving the line?[/b]

I understand the question 1 b) i.e. convert to uppercase the entire line but can't do 1 a) i.e. invert the case. Question 1 a) says (according to me) to change upper to lower case and vice versa.

I couldn't get the question number 2. i.e. numbering lines.

These questions are from the book "UNIX concepts and applicaions" by Sumitabha Das
Chapter 20, question number 20.4 and 20.11

Last edited by ravisingh; 03-30-2013 at 01:45 AM..
# 2  
Old 04-09-2013
Is this classwork?
80~
# 3  
Old 04-10-2013
No, its not classwork. I was practicing the questions from the book mentioned in my post. I have mentioned details from where I got the question.
I hope this is the right forum to post questions from a book.
This is no homework and no classwork, simply my practice.
# 4  
Old 04-10-2013
This is a special forum ONLY for homework questions!
# 5  
Old 04-19-2013
Thread reopened.
This User Gave Thanks to Corona688 For This Post:
# 6  
Old 04-26-2013
Well, googling around, I found :s/./\U&/g and :s/.*/\U&/ with the latter probably faster, \L for lower case, but so far no flipper in that ex space. (Also \u for just first char, \l to lower, so also :s/./\u&/g but not :s/.*/\u&/ ) The g~~ must be vim only, and while vim is common and downloadable it is far from universal.

Last edited by DGPickett; 04-26-2013 at 04:34 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Open Source

What editor does everyone use?

I was looking through the topics and I wasn't sure if this was the best place to post this question: I was wondering, out of curiosity, which software everyone was using to code their scripts in. I do mostly sh/ksh and my favorite has always been EditPlus because it is small, fast, yet powerful.... (409 Replies)
Discussion started by: yongho
409 Replies

2. Shell Programming and Scripting

How can I do this in VI editor?

version info : vi availabe with RHEL 5.4 I have a text file with 10,000 lines. I want to copy lines from 5000th line to 7000th and redirect to a file. Any idea how I can do this? Note: The above scenario is just an example. In my actual requirement, the file has 14 million lines and I want... (9 Replies)
Discussion started by: kraljic
9 Replies

3. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

4. SCO

regarding vi editor

hello friends, i wud like to get some suggestion for a Q i faced in an interview.......... the Q is........... suppose a person is working on vi .the file is very large and he hasn't saved anything ........suddenly power goes off and system shuts down ...after power comes up the system is... (4 Replies)
Discussion started by: girish_shukla
4 Replies

5. Solaris

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :License server is down (1 Reply)
Discussion started by: durgaprasadr13
1 Replies

6. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

7. UNIX for Dummies Questions & Answers

Pasting text in VI editor from a different editor

Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies

8. UNIX and Linux Applications

VI Editor

I need to delete a line of statement with vi editior in linux, i am using rm but won't work. (3 Replies)
Discussion started by: doyindayo
3 Replies

9. HP-UX

vi editor

I am new in hp ux and I want work with vi editor, but in hp ux vi editor the backspaes and del keys doesn't work. how can I enable them. thanks (3 Replies)
Discussion started by: hkoolivand
3 Replies

10. UNIX for Advanced & Expert Users

Vi Editor

I'm doing a teaching ass't for a basic unix course for a local college and we have given the new students an assignment where they have to code 10 pages of html by hand using the Vi Editor (i know it's cruel) The purpose of this exersize is to get them used to unix and vi commands and how the... (4 Replies)
Discussion started by: juxtaman
4 Replies
Login or Register to Ask a Question