vi, c/source/target g?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers vi, c/source/target g?
# 1  
Old 11-26-2002
vi, c/source/target g?

hi in vi, i have a file and i wanted to replace all wnix to unix. is the below correct.

c/wnix/unix g...

i have tried , and the above is not right...

help?
yls177
# 2  
Old 11-26-2002
Try this.....

$s/wnix/unix/g this should do the trick.. ...

or you can

#sed -e 's/wnix/unix/g' oldfile > newfile
(made changes on 11/27/02 at 10:10am)

Last edited by buRst; 11-27-2002 at 11:12 AM..
buRst
# 3  
Old 11-27-2002
Actually, in vi it's:
:%s/wnix/unix/g
# 4  
Old 11-27-2002
Sorry..... I guess in the excitement of my first post reply i did forget to test it proir to submitting reply.

thnx Perderabo and Congrats to you on the Unix.Com "Person of the Year Award kudos.......

Last edited by buRst; 11-27-2002 at 11:14 AM..
buRst
# 5  
Old 11-27-2002
:%s/wnix/unix/g

this will change globally..

how about searching each entry and then deciding whether to change it? guess must be the option g?

thanks
yls177
# 6  
Old 11-29-2002
I'm not sure that I understand your question, but maybe:
:%s/wnix/unix/gc
is what you're looking for...
# 7  
Old 11-29-2002
okay, let me explain again...
i wanted to be able to change one word by one word if i wanted to
yls177
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Move multiple files 4rm Source to different target folders based on a series num in the file content

Dear Experts my scenario is as follows... I have one source folder "Source" and 2 target folders "Target_123456" & "Target_789101". I have 2 series of files. 123456 series and 789101 series. Each series has got 3 types of fiels "Debit", "Refund", "Claims". All files are getting... (17 Replies)
Discussion started by: phani333
17 Replies

2. UNIX for Dummies Questions & Answers

How to count number files successfully copied from source to target location?

Hi Guys, how to count number of files successfully copied while coping files from source to destination path ex:10 files from source to target location copying if 8 files copied successfully then echo successfully copied=8 failure=2 files if two files get error to coping files... (2 Replies)
Discussion started by: sravanreddy
2 Replies

3. Post Here to Contact Site Administrators and Moderators

How to count successfully copy files source to target location with check directory in Linux?

Hi guys...please any one help me .... how to copy files from source to target location if 5 files copied successfully out of 10 files then implement success=10 and if remaining 5 files not copied successfully then count error=5 how to implement this condition with in loop i need code linux... (0 Replies)
Discussion started by: sravanreddy
0 Replies

4. Shell Programming and Scripting

Reconcilations script between Source and Target

Hi, I am new to DB2 and in need of urgent help. Here we have about 100 queries (SQL) that have been manually executed to retrieve totals from different tables and post it to Excel spreadsheet. Is there any way I can create a shell script as a wrapper and execute these queries and create a... (5 Replies)
Discussion started by: bhaskar v
5 Replies

5. Shell Programming and Scripting

Connect to target host from Source host.

Hi All, Need to connect to target host and execute a command and connect back to source host to continue with next set of command execution. Is there a utility/command using which we can connect to target host ? Please suggest. Note: Netezza database is instaled on Linux server. ... (4 Replies)
Discussion started by: Nagaraja Akkiva
4 Replies

6. HP-UX

After adding new iscsi target port, still the session state of that target port is showing offline

Hi, I wanted to configure new iscsi port on HPUX system, i added the target port address and configured it, once done, went to array side and searched for that host iqn number , but was nt able to find the same, came to host, then when i ran "iscsiutil -pVS" command it gave me below result ... (0 Replies)
Discussion started by: Vinay Kumar D
0 Replies

7. UNIX for Advanced & Expert Users

sudo needs to source target user's .shrc

I'm configuring a sudo Runas_Alias in the sudoers file on a hp-ux 11.31 system. The goal is to allow some hp-ux accounts to sudo to a service account and run commands as that user. Here's the related sudoers entries: User_Alias DMSTAFF = %dmstaff Runas_Alias DMALIAS = dmadmin DMSTAFF ... (2 Replies)
Discussion started by: mp5802
2 Replies

8. Shell Programming and Scripting

Shell script to transfer the files from source to target server.

I need to write a shell script to transfer the files every hour from source - target server. The cron job should be running every hour and shouldn't copy already copied files to the remote server ? I was able to write intial script but not able to get the logic for (in the next run it should... (12 Replies)
Discussion started by: radhirk
12 Replies

9. Shell Programming and Scripting

Source and Target count checking

Hi My source database is seibel and the target is oracle. I need to check the count for source query and target query. if it is equal then i need to send and success mail to an email id. If it is not equal need to send an failure mail to an email id. pl let me know about the script in ksh. ... (2 Replies)
Discussion started by: ksmbabu
2 Replies
Login or Register to Ask a Question