Timeline for Remove the exact same matching lines with sed
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 25, 2015 at 14:07 | comment | added | Lanti | I rethought my docker init process. The problem with external .sh scripts that the console logging not one by one, command by command. It's better to have the commands in the Dockerfile and separate the important ones by RUN line by line, this way you can see if something fails. Otherwise if you put everything into a one-liner command, or you use the \ line splitting, docker tossing you an error that the line failed and that's it. You just don't know what went wrong. The image creation with Dockerfile usually happening once, if there's no version update. So having more startup time no problem. | |
| Jun 24, 2015 at 17:20 | comment | added | Lanti | Dockerfile looks like can take multiline commands. See link: github.com/docker-library/php/blob/… | |
| Jun 24, 2015 at 17:17 | comment | added | hildred | I suppose you could rewrite it in perl which has better escaping. see revision. | |
| Jun 24, 2015 at 17:17 | history | edited | hildred | CC BY-SA 3.0 |
added perl and one line versions.
|
| Jun 24, 2015 at 17:00 | comment | added | Lanti | hildred! The reason why I don't do this because I don't want to delete future release names when this file become outdated. | |
| Jun 24, 2015 at 16:57 | comment | added | hildred |
how about just replacing the sources.list file with an echo "long line with \ns" > /etc/apt/sources.list. by using a single > it overwrites the whole file with a new version.
|
|
| Jun 24, 2015 at 16:53 | comment | added | Lanti | This script will be in a Dockerfile, to fire up a new docker image (it will be debian:latest with a few personal modification, installing sudo, etc.). It will have "RUN" command in front of the code showed here, that will run on the image creation process. I don't know unfortunately if that Dockerfile can take multiline bash commands or not. It's possible to call external .sh scripts with Dockerfile also, but I try to make it lightweight (only one Dockerfile). | |
| Jun 24, 2015 at 16:46 | comment | added | hildred |
\n does not have special meaning in this context you need a backslash newline. As for making it easy to type, do you have a webserver on the local network? if you do you can put the script on the web server and run it with wget -O - www.local|bash
|
|
| Jun 24, 2015 at 16:29 | comment | added | Lanti | I shortened to one liner, but I do something wrong because it's deleting everything from the file. Can you please check it? My reason heaving one liner is just I can easily enter the command in windows cmd, when I run Debian under Win Vagrant, Docker container. | |
| Jun 24, 2015 at 16:16 | comment | added | hildred | It technically is a one liner, but the a command has to have backslash newline pairs to do what you want. it could be shortened by removing the backslash newline pairs before the -e options, but that would only save four lines. | |
| Jun 24, 2015 at 16:07 | comment | added | Lanti | Wow, thank you very much, this is great! One question: can you modify this to be one liner? | |
| Jun 24, 2015 at 16:04 | vote | accept | Lanti | ||
| Jun 24, 2015 at 15:49 | history | answered | hildred | CC BY-SA 3.0 |