09-15-2006
This works fine for me.
> more a1.txt
1
2
3
4
5
> cat a1.txt | sed -e '1 i\ newLine' > newa1
> more newa1
newLine
1
2
3
4
5
Please check if "-e" is the correct parameter for your sed
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm sure you guys have answered this elsewhere but I can't seem to find where so here goes.
#!/bin/bash
n=120
a=$(sed '120q;d' energy.xvg)
while ;do
a=$(sed $n'q;d' energy.xvg)
echo "$a \n" > newfile
n=$(($n+100))
done
exit 0
that script should read the file energy.xvg, start at... (1 Reply)
Discussion started by: gelitini
1 Replies
2. Shell Programming and Scripting
I need a perl script to find and replace a specific pattern in a file to a new line.
BAsically I have a single line data in a file with 10 mb to 200 MB. I want to put a new line based on a specific pattern to open the file in Excel / Access.
Following is the sample data in a file
... (1 Reply)
Discussion started by: portalfaq
1 Replies
3. Shell Programming and Scripting
I have posted it previously but somehow could not delete the previous post.I felt i could not explain the problem statement well.
Here t goes.I have a file say File1. Now i need a specific pattern from the lines to be added to the other line.
File:
red blue green ABC.txt@ABC END
black... (1 Reply)
Discussion started by: ngupta
1 Replies
4. Shell Programming and Scripting
Hi,
I have this line:
ip=111.222.133.144,mac=00:16:3E:2A:08:3C,vifname=veth360','ip=10.2.3.4,vifname=veth360a'
^
|
-------
I want to insert this IP 144.133.222.111 between "144"... (4 Replies)
Discussion started by: iga3725
4 Replies
5. Shell Programming and Scripting
Friends ,
I have a large file and i need to insert a line after every line.I am actually unaware how to do it.Any help appreciated.
My File
control station *ATM* , qread $OSS.Jul13A.FI01 interval 1 intcount 1
control station *ATM* , qread $OSS.Jul13A.FI02 interval 1 intcount... (4 Replies)
Discussion started by: appu2176
4 Replies
6. Shell Programming and Scripting
Could anyone tell me how to insert a line at a particular line number using sed.
sed '2i\newtext' filename
I have tried the above command .But it is not working. I am using tcsh shell .Please help.
Double post, continued here (0 Replies)
Discussion started by: maitree
0 Replies
7. Shell Programming and Scripting
hello ..
I am new to perl scripting, I have a text file, and would like to insert 3 new lines into the same file at different line numbers using perl scripting. Any Help regarding this will be very useful.
say the file is sample.txt, contents are
aaaaa
bbbb
ccccc
dddd
eeeee
ffffffff... (4 Replies)
Discussion started by: hemalathak10
4 Replies
8. Shell Programming and Scripting
I need to insert text from one file into another file after specific term. I guess sed is the best method of doing this and I can insert a specified text string using this script but I am not sure how to modify it to insert text from another file:
#!/bin/sh
sed 's/\<VirtualHost... (17 Replies)
Discussion started by: barrydocks
17 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I've been trying to get a script working that fetches weather-data and converts it into an .ics file. The script works so far put I'm stuck at the point where I need to add specific static data. A thorough search through the forum did not point me into the right direction.
#!/bin/bash... (3 Replies)
Discussion started by: Schubi
3 Replies
10. Shell Programming and Scripting
Hi,
consider a file called mobile.txt as follows:
For type lovers, add a new line at the end of it by copying its previous line and add a +1 to the field1, field2
Additionally, there are only 3 plans available to lovers type, so it should not work for lovers type already having 3 lines under... (11 Replies)
Discussion started by: Gautham
11 Replies
LEARN ABOUT DEBIAN
gridlock
GRIDLOCK(6) Games Manual GRIDLOCK(6)
NAME
Gridlock - collection of grid-based board games
SYNOPSIS
Gridlock
DESCRIPTION
This manual page documents briefly the Gridlock command.
Gridlock is a collection of several grid-based strategy games. The games include Ataxx, Reversi, Gomoku, Connect Four, Breakthrough, Glass
Bead, Hexapawn, Quad Wrangle, Cats and Dogs and Moray Eels.
After launching the application, the game window will appear. Select the game you want to play from the "Game" popup menu in the upper
right. Some games have different starting configurations (board size, grid layout, etc); when one of those games are selected a "Configura-
tions" popup menu will appear from which you can select a configuration.
The bottom right displays the color and status of the two players. Each player's color is shown by a circle; the player whose turn it is
has a filled circle. For games in which players have a score (Ataxx, Eeversi, Glass Bead), the scores are shown next to the player labels.
Popup windows underneath each player's label allow you to specify whether each player is human or computer-controlled, and the difficulty
of computer players. (Note that "Hard" computer opponents may take a long time to make their moves).
The rest of the window contains the game board. To make a move, click on the cell where you wish to place a piece. Ataxx and Breakthrough
require that you move from one cell to another; to do this first click on the cell you wish to move from, then click on the cell you wish
to move to. For all games, cells that are legal moves will become highlighted when you move the mouse over them. If you are unable to make
a move, you can pass by clicking the "Pass" button on the right. The "Restart" button will restart the game, requiring confirmation if a
game is in progress.
You can play these games over the network. It is possible to save and load games.
SEE ALSO
GNUstep(7).
AUTHOR
This manual page was written and updated by Gurkan Sengun <gurkan@linuks.mine.nu>, for the Debian GNU/Linux system (but may be used by oth-
ers).
October 17, 2003 GRIDLOCK(6)