Find Jobs
Hire Freelancers

bash sed find and replace - open to bidding

$10-30 USD

Fechado
Publicado há quase 8 anos

$10-30 USD

Pago na entrega
I need a bash script to do this: I have folder that contain html files and subfolders. now files name as [login to view URL], [login to view URL] etc. i want to replace the original file name with the title tag of the file ( instead of the space between the words i would like to add "_". then replace all links in all folder that contain the original name with the new title name. example of title - <title>admin/environment/php some text</title> change to <title>php_some_text</title> then to replace all links in all files that contain the old links to the new file name that will be php_some_text.html. all my needs have a solutions in my script but don't know how to replace the link all over to the new file name. my script: #!/bin/bash cd /var/www/clients/client1/web2/web/docs/31/en find . -name "*.html" > [login to view URL] while read -r filepath ; do # Considering the subfolder can have spaces, # We will start by separating the filename # And dirname folderpath=`dirname "$filepath"` filename=`basename "$filepath"` # With GNU GREP new_name=$(grep -oP '<title>\K.+?</title>' "$filepath" | sed 's#</title>##' | tr ' ' '_' ) #echo new_name=$(grep -oP '<title>\K.+?</title>' "$filepath" | sed 's#</title>##' | tr ' ' '_' ) # With BSD GREP (for who need the info) # new_name=$(grep -o '<title>.*</title>' $filepath | sed -e 's/<title>\(.*\)<\/title>/\1/g' | sed -e 's/$filename/$new_name/g' | tr ' ' '_') #if [[ $new_name = */* ]]; then echo "/${new_name##*}"; else echo "$new_name"; fi mv -v "$filepath" "$folderpath/`basename $new_name`.html" ### command that i tried to solve the link url issue #find /var/www/clients/client1/web2/web/docs -type f -exec sed -i 's/$filename/$new_name/g' {} \; #grep -rl '$filename' /var/www/clients/client1/web2/web/docs/31/en | xargs sed -i 's/$filename/$new_name/g' *.html #sed -i 's/$filename/$new_name/gi' *.html done < [login to view URL] Thank you
ID do Projeto: 10796706

Sobre o projeto

14 propostas
Projeto remoto
Ativo há 8 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
14 freelancers estão ofertando em média $37 USD for esse trabalho
Avatar do Usuário
Hello Let's explore the requirement and kindly let us know if you would like us to share our skills & experiences with previous development. Thanks & Regards Moumita
$141 USD em 4 dias
4,9 (60 avaliações)
6,1
6,1
Avatar do Usuário
Sir, I've graduated in computing back a few years ago and been working at an ISP whee I hold a sysadmin position. As I need more money - I am back on this website. I have been usinf Linux for 7 years, Ubuntu/Debian being my favorite distribution. I have skills in BASH, Python, C, and other programming languages. My daily work is to set up and maintain servers, of all types: high availability (nginx, php-fpm, backuppc, xen, load balancing), backups, security, mail servers, setup of various things.. I also install various things for ours customers like CMS or Linux scripts / software. Please come and chat with me. I usually work on weekends so it'd be nice to begin soon :) Regards;
$35 USD em 1 dia
4,9 (37 avaliações)
4,5
4,5
Avatar do Usuário
20+ years of programming in Unix-like operating systems like linux. I am proficient in all sorts of shell programming and can solve your problem almost immediately. Best regards, Robert
$30 USD em 1 dia
5,0 (2 avaliações)
3,5
3,5
Avatar do Usuário
Hi, I have the piece of code you need, I did basic testing and it works. I can send it to you imediately. You can see I have passed Shell Script exam. Create a milestone with 100% amount which is 25 USD and I will send you your improved script imediately. If the script doesn't work or not fully work in the way as you specified in the project description, it will be resolved until it works flowlessly. Regards
$25 USD em 1 dia
5,0 (3 avaliações)
3,0
3,0
Avatar do Usuário
Hello! I have experience with bash scripting. I would like to know more details. Can I make a C program for replacing the html names after changing them? I can do this in bash too. Please contact me :).
$30 USD em 0 dia
0,0 (0 avaliações)
0,0
0,0
Avatar do Usuário
if you are olready renamed files and all what remanes is to change titles inside the html then thats all is one line command inshell using xargs and sed if nothing is done then I can write a script in 30 minutes.
$25 USD em 0 dia
0,0 (0 avaliações)
0,0
0,0
Avatar do Usuário
Sorry, but i think i can make your job done with python... I am not so familiar with bash script yet. If you don't mind, I can try to fix it. Best, Daisy
$25 USD em 1 dia
0,0 (0 avaliações)
0,0
0,0
Avatar do Usuário
YOUR SHELL SCRIPT IS ALREADY DONE!!! Hire me and you will receive it immediately. The script was made in two versions: 1st using grep and sed; 2nd using Perl. As you can see, I am novice at Freelancer.com. This is the reason I have chosen the lowest price (I need the initials reviews and recommendations to build my reputation). I have a good experience programming with shell script in my job as a system administrator.
$10 USD em 1 dia
0,0 (0 avaliações)
0,0
0,0
Avatar do Usuário
i am a linux developer and often creating service using shell script
$26 USD em 1 dia
0,0 (0 avaliações)
0,0
0,0
Avatar do Usuário
I have over 15 years of text processing experience with perl, php, regular expressions, etc. This is what I do on a daily basis, and I can provide a solution in less than 1 hour.
$25 USD em 1 dia
0,0 (0 avaliações)
0,0
0,0

Sobre o cliente

Bandeira do(a) ISRAEL
Kfar saba, Israel
5,0
1
Método de pagamento verificado
Membro desde jan. 8, 2012

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.