İptal Edildi

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

Beceriler: Kabuk Betiği, UNIX

Daha fazlasını gör: 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

İşveren Hakkında:
( 49 değerlendirme ) Lyndhurst, United States

Proje NO: #13335308

Bu iş için 25 freelancer ortalamada $21 teklif veriyor

dkokmadis

A proposal has not yet been provided

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(17 Değerlendirme)
4.1
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

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(5 Değerlendirme)
3.5
srinichal

ready to deliver

$15 USD in 2 gün içinde
(8 Değerlendirme)
3.7
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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(2 Değerlendirme)
3.2
1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(5 Değerlendirme)
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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(3 Değerlendirme)
1.8
jperusan

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

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(1 Yorum)
1.0
nareshreddy1310

Dear, I have been working as a Test Engineer from past three years in a reputed organistaion and working for automation of telecom projects . I hope that my expereince will help you to sort out the script as earl Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
muhammadmomon

i had managed to remove the line which contain the mentioned string: [login to view URL] localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
tarundagar

Hi, The task you are asking help for is very basic in shell scripting and need not be offered more than 1$. I can do it for minimum amount. Regrads, Tarun dagar

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
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 Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
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

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
vinaybsv

A proposal has not yet been provided

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
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,

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
sahilnarain

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

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
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

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
johnerramirez

A proposal has not yet been provided

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0