Đã Hủy

Simple UNIX Script fix - remove 1 line from file

here is the file that I have; want to be able to remove ONE line from the file containing a string that matches, the following command is being used and is not working.

sudo sed '/chefmaster/d' ./myhost1 > ./myhost2

Any thoughts ?

127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

[url removed, login to view] [url removed, login to view] chefnode

[url removed, login to view] [url removed, login to view] chefmaster

Kĩ năng: Shell Script, UNIX

Xem nhiều hơn: simple file watcher unix script, linux script remove line file perl, remove line file script, linux, shell script, system admin, script remove line file, shell script append file remove line, shell script remove line file, shell remove line file, shell script delete line file, file handling unix script, find delete line file shell script, shell script delete add line file, shell script add line file, remove single line file shell scripting, shell script remove single line file, compare file remove lines shelll script

Về Bên Thuê:
( 49 nhận xét ) Lyndhurst, United States

ID dự án: #13335308

25 freelancer chào giá trung bình$21 cho công việc này

dkokmadis

A proposal has not yet been provided

$25 USD trong 1 ngày
(17 Nhận xét)
4.1
srinichal

ready to deliver

$15 USD trong 2 ngày
(8 Nhận xét)
3.7
pauldj

17 years experience with System Administration and Computer Security. [login to view URL] profile - [login to view URL] Skype ID - pdjoyner Contact me to discuss this project. Thank you, Paul Joyner

$100 USD trong 1 ngày
(5 Nhận xét)
3.5
versacode

Hello! We are a group of electrical engineers and web developers. We will be happy to help you with a sed command that matches and deletes a line from a file. You may drop us a PM anytime and we will be happy to assist Thêm

$15 USD trong 1 ngày
(2 Nhận xét)
3.2
$15 USD trong 1 ngày
(5 Nhận xét)
2.4
ignaciorodrguez

Hi there. Basically you have (this is the text file): hello world hello hello And you want to remove the lines that contains hello, right? $ cat a hello world hello world $ sed '/hello/d' a > b $ cat b Thêm

$30 USD trong 1 ngày
(3 Nhận xét)
1.8
jperusan

You're missing < redirection, so correct command would be: sudo sed '/chefmaster/d' <./myhost1 >./myhost2 And it works. :-)

$10 USD trong 1 ngày
(1 Nhận xét)
1.0
$30 USD trong 1 ngày
(0 Nhận xét)
0.0
vw8150693vw

Hi, I have very good experience in shell script and I have done many projects ,its guaranteed to solve this in time please contact me I will help you , hope work together

$20 USD trong 1 ngày
(0 Nhận xét)
0.0
shpr0t

hi maybe i can help you!!! you need del string "chefmaster" ? .

$15 USD trong 1 ngày
(0 Nhận xét)
0.6
PhysicsPhdSb

Hi. Can you please indicate the version of your sed by doing: sed --version You can accomplish the same thing using another standard unix command. I can explain that if I am awarded this "project". My bid Thêm

$10 USD trong 1 ngày
(0 Nhận xét)
0.0
mawkee

I can provide the answer in a minute after the bid is accepted. It's pretty clear what you want to do and very simple.

$10 USD trong 0 ngày
(0 Nhận xét)
0.0
johnerramirez

A proposal has not yet been provided

$30 USD trong 1 ngày
(0 Nhận xét)
0.0
$25 USD trong 1 ngày
(0 Nhận xét)
0.0
Aydo1040

Hi , Why you didn't remove the line manually on the file with vi or nano ? Do you need absolutely to use sed ? Best regards,

$15 USD trong 1 ngày
(0 Nhận xét)
0.0
pasagadisriram

Hi, I can do shell scripting and have good knowledge of editing files through shell script. Hire me If you need a quick solution which is 100% working. Regards, Sriram

$15 USD trong 1 ngày
(0 Nhận xét)
0.0
sahilnarain

Experienced devops engineer + sysadmin here. Could help you with this in no time :) Hoping to hear back from you soon!

$30 USD trong 1 ngày
(0 Nhận xét)
0.0
vinaybsv

A proposal has not yet been provided

$10 USD trong 1 ngày
(0 Nhận xét)
0.0
ubica

hi, do you just want to remove all the lines containing 'chefmaster'? if not (e.g. only the first/nth occurrence), there's no simple sed one-liner and you are going to be looking at awk or handmade sh

$25 USD trong 1 ngày
(0 Nhận xét)
0.0
taxthelm

I am a DevOps engineer with a lot of scripting experience. this project should not be an issue and I would be happy to have the opportunity to help you out. Please contact me if you would like to discuss details about Thêm

$15 USD trong 1 ngày
(0 Nhận xét)
0.0