skip to Main Content

Replace same occurrence of word with different words using sed – CentOS

I want to replace 2 same words in file(app.properties) with 2 different words using sed command. Example: mysql.host=<<CHANGE_ME>> mysql.username=testuser mysql.port=3306 mysql.db.password=<<CHANGE_ME>> required output will be mysql.host=localhost mysql.username=testuser mysql.port=3306 mysql.db.password=password123 I tried below command: sed -e "s/<<CHANGE_ME>>/localhost/1" -e "s/<<CHANGE_ME>>/password123/2" app.properties >…

VIEW QUESTION

how to count the num of ports in docker ps cmd?

docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f56084659b2a nginx:alpine "/docker-entrypoint.…" 35 seconds ago Up 33 seconds 0.0.0.0:3456->3456/tcp, 0.0.0.0:38080->80/tcp xenodochial_perlman what is the cmd to actually count num of ports from PORTS column in 1 line?

VIEW QUESTION
Back To Top
Search