how to insert a extra line in a text file using a sh command
iam trying to think of a way to add a extra line but without deleting the whole text
do anyone have any ideas (2 Replies)
So I need to write lines into line X of file X.
I can get the file by doing:
cfgnumber=$(cat -n -comm.cfg| grep -i "servicegroup_name 24x7-comunicacions")
echo $cfgnumber
it outputs the Line where it finds now I need to start writing something right bellow that line.
thanks (10 Replies)
Dear Folks :),
I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp.
I can do this in vi editor by using this command :g/^/s//BBB_
e,g I have a file named as Test.dat and it containins below text:
michal... (4 Replies)
I can't seem to get sed to allow me to insert text in the first line of an empty file. I have a file.txt that is a 0 byte file. I want sed to insert " fooBar" onto the first line. I've tried a few options and nothing seems to work. They work just fine if there's text in the file tho. Help? (4 Replies)
sed '1r file.txt' <source.txt >desti.txt
This example will insert 'file.txt' between line 1 and 2 of source.txt.
sed '0r file.txt' <source.txt >desti.txt
gives an error message.
Does anyone know how 'sed' can insert 'file.txt' before the first line of source.txt? (18 Replies)
Hello,
I am trying to add a line (usually just a word) to some text files in a directory that are already sorted. I just don't want to run the sort command again because it can take a long time when the text or log files are really huge. I have a bashscript that will take in the 1st argument... (7 Replies)
I have a test file that I want to read and insert only certain lines into the
the table based on a filter.
1. Rread the log file 12 Hours back Getdate() -12 Hours
2. Extract the following information on for lines that say "DUMP is
complete"
A. Date
B. Database Name
C.... (2 Replies)
Hi All,
I am using UNix Sun OS sun4u sparc SUNW,SPARC-Enterprise
My intention is to insert a line of text after 13th line of every file inside a particular directory.
While trying to do it for a single file , i am using sed
sed '3 i this is the 4th line' filename
sed: command garbled: 3... (5 Replies)
I am new to Perl. I wrote a Perl program that inserts text "EnableScrollableCursors=3" after a section of contexts in the odbc.ini file matches a variable in an array list. "EnableScrollableCursors=3" is added to a newline before whitespaces separate each section of contexts in the odbc.ini.
... (0 Replies)
Discussion started by: dellanicholson
0 Replies
LEARN ABOUT DEBIAN
phear
PHEAR(6) Games Manual PHEAR(6)NAME
phear - enter the cavez of phear
SYNOPSIS
phear [-e <level filename>] | [level name]
OPTIONS
This program has several arguments:
-e Start editor instead of game on a specific level.
level name
Name of the level to play, f.ex 01
level filename
Filename of the level to edit. f.ex /usr/share/phear/data/levels/01
DESCRIPTION
This is a boulder dash type of game, for terminals. You walk around in a ASCII underground cave system, where you need to keep clear of
boulders falling down while you are digging through the dirt searching for diamonds.
To play you have to know these keys:
right - move right
left - move left
up - move up
down - move down
b - place bomb
t - detonate bombs
q - leave game
By picking up a diamond (*) you get 10 points, picking up money ($) gives you 100 points. You get one extra life for every 1000 points you
score.
Move around with the arrow keys or the 2-4-8-6 keys. Press 'k' to commit suicide if you should get stuck.
Got the bombs (%)? Great! Press 'b' to place them, and 't' to detonate them all at once. Note that the bombs you place will act just like
stones, affected by gravity, rolling, and so on..
Watch out for monsters (M) -- if they catch you, you will die. To fight back, drop stones on them or blow them up using your bombs.
Pressing 's' will enable/disable sound, 'w' will highlight your current position.
EDITOR
The editor has its own keys you need to know:
0-9 - Keys 0-9 places objects
s - Saves the map
l - Enables lock-mode (lets you draw continuously using the arrow-keys)
q - Quits the editor
AUTHOR
Cavez of Phear was written by Tom Rune Flo <tom@x86.no>.
This manual page was written by Hakon Nessjoen <haakon.nessjoen@gmail.com>, with parts of it written by Tom Rune Flo <tom@x86.no>, for the
Debian project (and may be used by others).
November 30, 2011 PHEAR(6)