Dear All,
I have a file called football where i have a list of 11 players each on different lines.
I wish to add a name of another player on the first line.
I have created a file called footballscript in vi writing the following sed command to achieve this ...
cat football | sed -e '1 i\... (4 Replies)
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)
Hi,
I have two files XXX.dat and YYY.dat and their contents are as follows.
The contents of XXX.dat(The line numbers are just for reference)
1) Mango
2) Banana
3) Papaya
4) Apple
5) Pomegranate
The contents of YYY.dat
1) Custard apple
2) Grape
3) ... (4 Replies)
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)
this is utterly embarassing :(
after posting here i revisited my files and found that when i used "vi" instead of a gui based editor, i suddenly found that the indentations were in fact wrong :(
sorry about this :( (0 Replies)
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)
I use zentyal for my server admin, which is great but zentyal auto-generates config file on boot and hence overwrites any changes made directly to config files. In order to allow multiple user access to a MS ACCESS database, I need to customise the smb.conf file and add the following line to the... (9 Replies)
Hello All,
I have following file contents
cat file
#line=aaaaaa
#line=bbbbbb
#line=cccccc
#line=dddddd
line=eeeeee
#comment=11111
#comment=22222
#comment=33333
#comment=44444
comment=55555
Testing script
Good Luck!
I would like to comment line line=eeeeee and insert a new line... (19 Replies)
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)
Hi
This is my first post and I'm just a beginner. So please be nice to me.
I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file?
I have tried sed -n 241,241p... (13 Replies)
Discussion started by: dejavo
13 Replies
LEARN ABOUT BSD
cp
CP(1) General Commands Manual CP(1)NAME
cp - copy
SYNOPSIS
cp [ -ip ] file1 file2
cp [ -ipr ] file ... directory
DESCRIPTION
File1 is copied onto file2. By default, the mode and owner of file2 are preserved if it already existed; otherwise the mode of the source
file modified by the current umask(2) is used. The -p option causes cp to attempt to preserve (duplicate) in its copies the modification
times and modes of the source files, ignoring the present umask.
In the second form, one or more files are copied into the directory with their original file-names.
Cp refuses to copy a file onto itself.
If the -i option is specified, cp will prompt the user with the name of the file whenever the copy will cause an old file to be overwrit-
ten. An answer of 'y' will cause cp to continue. Any other answer will prevent it from overwriting the file.
If the -r option is specified and any of the source files are directories, cp copies each subtree rooted at that name; in this case the
destination must be a directory.
SEE ALSO cat(1), mv(1), rcp(1C)4th Berkeley Distribution June 8, 1985 CP(1)