edit a file without use editor vi


 
Thread Tools Search this Thread
Operating Systems Solaris edit a file without use editor vi
# 1  
Old 02-22-2011
edit a file without use editor vi

hi all
i have a problem i want to edit a file without use the "vi" .
for example i want to edit a passwd file without to do "vi" in file.
how i can to do this?
Regards
# 2  
Old 02-22-2011
form CLI usually sed is used
# 3  
Old 02-22-2011
depending on the O/S....ed, sed, emacs, umeacs, jed, vim, awk, perl...
could you give us more info ?
# 4  
Old 02-22-2011
Quote:
for example i want to edit a passwd file without to do "vi" in file.
Unless you know what you are doing, only use vipw to edit the /etc/paswd file!
# 5  
Old 02-22-2011
you can use grep and sed command to solve that problem.
if the file having delimiter then you can use awk command.

regards
rajesh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh script to edit a file using vi editor

I was wondering if it is possible to execute a script that will remove a certain search pattern from a file and save it? Manually I would just hit escape to enter command mode then search and delete the pattern "./srv 135.0.0.1.11111 210;=1" then save & exit the file vi command to search and... (3 Replies)
Discussion started by: seekryts15
3 Replies

2. UNIX for Advanced & Expert Users

Edit file

Hi All, I have file with 200K Records and each line with 400 character. I need to edit the some part of the file. For example, i need to edit character from 115 to 125, 135to 145 and 344 to 361 Can you please anyone help me to do this? Regards, (1 Reply)
Discussion started by: balasubramani04
1 Replies

3. Shell Programming and Scripting

Edit a file

I have file like cp -p /var/adm/ /tmp1/tmp1.log cp -p /var/adm/ /tmp1/tmp2.log cp -p /var/adm/ /tmp1/tmp3.log cp -p /var/adm/ /tmp1/tmp4.log I need to re-write the file like: cp -p /var/adm/tmp1.log /tmp1/ cp -p /var/adm/tmp2.log /tmp1/ cp -p /var/adm/tmp3.log /tmp1/ cp -p... (3 Replies)
Discussion started by: h_banka
3 Replies

4. Shell Programming and Scripting

Script to Edit the file content and create new file

I have a requirement, which is as follows *. Folder contains list of xmls. Script has to create new xml files by copying the existing one and renaming it by appending "_pre.xml" at the end. *. Each file has multiple <Name>fileName</Name> entry. The script has to find the first occurance of... (1 Reply)
Discussion started by: sudesh.ach
1 Replies

5. 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

6. UNIX for Dummies Questions & Answers

edit a .fs file

I have a .fs file that I want to edit, (or just be able to see what is in it) preferably through a windows environment. Does anyone know how to do that? Thanks (4 Replies)
Discussion started by: kiterboy
4 Replies

7. Shell Programming and Scripting

Edit txt file using vi editor

Dear All I have a file called sample.txt which contains as follows HR Files records Loaded RecordDate Unloaded -- ---- -------- --------- ------------ ------ 00 567 77777 67896 0 0 01 345 345567 45678 0 ... (1 Reply)
Discussion started by: tkbharani
1 Replies

8. UNIX for Dummies Questions & Answers

Edit the File

Hello Everyone I am new to this forum. I am having a requirement to edit the file(the file is having some sql code). And this file is in my colleagues login. This is readonly Now I would like to edit this file. In which way can I do this? (1 Reply)
Discussion started by: pradkumar
1 Replies

9. Shell Programming and Scripting

file edit help

Hi, Could anyone give me a idea how to strip the lines from a given file. example *********** 1st occurence 1st occurence 1st occurence 1st occurence *********** 2nd occurence 2nd occurence 2nd occurence 2nd occurence 2nd occurence 2nd occurence ************* 3rd occurence 3rd... (10 Replies)
Discussion started by: sentak
10 Replies

10. UNIX for Dummies Questions & Answers

file name edit

ok I have a list of files for example: 130-4-32.HindIII.0.ids 130-4-32.HindIII.0.ppm 130-4-32.HindIII.0.ppm.gz 130-4-33.HindIII.0.bands 130-4-33.HindIII.0.ics 130-4-33.HindIII.0.ids 130-4-33.HindIII.0.ppm 130-4-33.HindIII.0.ppm.gz 130-4-34.HindIII.0.bands ... (1 Reply)
Discussion started by: lorcet222
1 Replies
Login or Register to Ask a Question