If you know vim, you know a lot more about ed than you think you do.
If you're in vim and you type in the command:
and then type in the two lines:
What will happen. (It will insert the text geneID filename as a new line of text that will appear before the 1st line that was in the file before.)
And then what happens if you type in the command:
(It will write the updated buffer back to the file you are editing.)
The ed (and ex) utilities give you most of the commands that you type into vim that start with a colon, but do not need (or accept) the colon.
This User Gave Thanks to Don Cragun For This Post:
:confused: There is a flat file on my system which contains email addreses of people in my company. This file is utilized when sending notifications for various things. However nobody knows where this file is located or what it is named. The only thing we know is the email address of a user who... (4 Replies)
Dear Experts,
Please help to teach me how to add the filename into the file content.
Actually the file name are EVENTS-20050912.
***************New output that I want***************
EVENTS-20050912 03:33:37 ALARM: BTSSPAN-277-1 30-18013
EVENTS-20050912 12:10:28 ALARM: BTSSPAN-297-2... (1 Reply)
Hi,
I have to rename all occurance of CUST_MST to RESELLER_MST both in filename and file content under a directory (say D0) which contains multiple (2-3 levels) sub directory.
Example:
D0 -> D1 -> D2 has a file CUST_MST_TEMP.txt
this contains :
> cat /D0/D1/D2/CUST_MST_TEMP.txt... (3 Replies)
How can i prepend the content of a file to another file? I tried:
sed '1r textfile' myfile
but it inserted the text AFTER the first line? What would be a good method?
I can easily append lines to a file using the ">>" operator, is the something similar in bash to prepend lines?
Kind regards... (2 Replies)
I have two files. File 'a' has contents:
1|1
2|2
3|3
4|4
and file 'b' has contents:
abc|def
hij|klm
nop|qrs
tuv|wxy
I would like to prepend file 'a' to file 'b' (with pipe) such that the contents of 'b' will be:
1|1|abc|def
2|2|hij|klm
3|3|nop|qrs
4|4|tuv|wxy (3 Replies)
I want to print out a directory listing, then append ] to the end of each line. I'm trying to create a list of Wiki links based on folder listings that i can just copy and paste without having to edit 100's of file listings.
Using sed i've figured out to do something like this:
sed... (4 Replies)
Currently I am redirecting STDERR and STDOUT to a log file by doing the following
{
My KSH script contents
} 2>&1 | $DEBUGLOG
Problem is the STDERR & STDOUT do not have any date/time associated.
I want this to be something that i can embed into a script opposed to an argument I use... (4 Replies)
Hi,
I have a process which outputs to a log.
Below is the code snippet:
process &> $LOGFILE&
The log file keeps on updating whenever a transaction is processed.
The log file has a time stamp added so every time I kill the process and start the process a new log file is... (4 Replies)