Sponsored Content
Full Discussion: Help with vi editor
Top Forums UNIX for Dummies Questions & Answers Help with vi editor Post 302758325 by Yoda on Friday 18th of January 2013 11:55:30 PM
Old 01-19-2013
%s/^/##hello#/ matches the start of every line and prepends or add to the beginning the pattern ##hello#

For further reference vimregex
This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Vi editor ?

Hello everybody, My question is: how to add /tmp/work at the end of line in vi editor. my file looks like: cp file1 cp file2 cp file3 **** I need to add " /tmp/work" at the end of each line. I tried this :%s/$/" /tmp/work" and this :%s/$/\ /tmp/work\/ but it does not work. (2 Replies)
Discussion started by: billy5
2 Replies

2. HP-UX

instead VI editor - which one?

I'd like to find some editor for HP-UX, something like notepad, but not VI editor. Can someone have some ideas which one? thx (6 Replies)
Discussion started by: diamond
6 Replies

3. UNIX for Advanced & Expert Users

vi editor

Hi, how can I add at the begining and at the end of all of the lines of my text file in VI editor ? Many thanks before. for exemple if in my file i have line 1 line 2 I want to have : start line 1 end start line 2 end (3 Replies)
Discussion started by: alain123456
3 Replies

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

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

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

8. Shell Programming and Scripting

About vi editor

How can ` character be printed on vi editor ? empl_id=`echo $line | awk ' { print $1; } '` (2 Replies)
Discussion started by: senem
2 Replies

9. Shell Programming and Scripting

Not able to use @ in VI editor

Hello All, Need one Help for one issue. I am using a French Keyboard, so @ sign is on key 0 and i have to use right Alt + 0 to print it. It is working everywhere but not inside Vi editor. I can type @ in shell, in notepad. But inside Vi editor it is not working, another problem is that if... (2 Replies)
Discussion started by: yadavricky
2 Replies

10. 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
GIT-REPLACE(1)                                                      Git Manual                                                      GIT-REPLACE(1)

NAME
git-replace - Create, list, delete refs to replace objects SYNOPSIS
git replace [-f] <object> <replacement> git replace [-f] --edit <object> git replace [-f] --graft <commit> [<parent>...] git replace -d <object>... git replace [--format=<format>] [-l [<pattern>]] DESCRIPTION
Adds a replace reference in refs/replace/ namespace. The name of the replace reference is the SHA-1 of the object that is replaced. The content of the replace reference is the SHA-1 of the replacement object. The replaced object and the replacement object must be of the same type. This restriction can be bypassed using -f. Unless -f is given, the replace reference must not yet exist. There is no other restriction on the replaced and replacement objects. Merge commits can be replaced by non-merge commits and vice versa. Replacement references will be used by default by all Git commands except those doing reachability traversal (prune, pack transfer and fsck). It is possible to disable use of replacement references for any command using the --no-replace-objects option just after git. For example if commit foo has been replaced by commit bar: $ git --no-replace-objects cat-file commit foo shows information about commit foo, while: $ git cat-file commit foo shows information about commit bar. The GIT_NO_REPLACE_OBJECTS environment variable can be set to achieve the same effect as the --no-replace-objects option. OPTIONS
-f, --force If an existing replace ref for the same object exists, it will be overwritten (instead of failing). -d, --delete Delete existing replace refs for the given objects. --edit <object> Edit an object's content interactively. The existing content for <object> is pretty-printed into a temporary file, an editor is launched on the file, and the result is parsed to create a new object of the same type as <object>. A replacement ref is then created to replace <object> with the newly created object. See git-var(1) for details about how the editor will be chosen. --raw When editing, provide the raw object contents rather than pretty-printed ones. Currently this only affects trees, which will be shown in their binary form. This is harder to work with, but can help when repairing a tree that is so corrupted it cannot be pretty-printed. Note that you may need to configure your editor to cleanly read and write binary data. --graft <commit> [<parent>...] Create a graft commit. A new commit is created with the same content as <commit> except that its parents will be [<parent>...] instead of <commit>'s parents. A replacement ref is then created to replace <commit> with the newly created commit. See contrib/convert-grafts-to-replace-refs.sh for an example script based on this option that can convert grafts to replace refs. -l <pattern>, --list <pattern> List replace refs for objects that match the given pattern (or all if no pattern is given). Typing "git replace" without arguments, also lists all replace refs. --format=<format> When listing, use the specified <format>, which can be one of short, medium and long. When omitted, the format defaults to short. FORMATS
The following format are available: o short: <replaced sha1> o medium: <replaced sha1> -> <replacement sha1> o long: <replaced sha1> (<replaced type>) -> <replacement sha1> (<replacement type>) CREATING REPLACEMENT OBJECTS
git-filter-branch(1), git-hash-object(1) and git-rebase(1), among other git commands, can be used to create replacement objects from existing objects. The --edit option can also be used with git replace to create a replacement object by editing an existing object. If you want to replace many blobs, trees or commits that are part of a string of commits, you may just want to create a replacement string of commits and then only replace the commit at the tip of the target string of commits with the commit at the tip of the replacement string of commits. BUGS
Comparing blobs or trees that have been replaced with those that replace them will not work properly. And using git reset --hard to go back to a replaced commit will move the branch to the replacement commit instead of the replaced commit. There may be other problems when using git rev-list related to pending objects. SEE ALSO
git-hash-object(1) git-filter-branch(1) git-rebase(1) git-tag(1) git-branch(1) git-commit(1) git-var(1) git(1) GIT
Part of the git(1) suite Git 2.17.1 10/05/2018 GIT-REPLACE(1)
All times are GMT -4. The time now is 09:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy