You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat a.txt
ip:111.111.111.111 text text text
ip:222.222.222.222 text text text
ip:333.333.333.333 text text text
ip:444.444.444.444 text text text
# Remove the line in file and print file with STDOUT
$ sed '/222.222.222.222/d' a.txt
ip:111.111.111.111 text text text
ip:333.333.333.333 text text text
ip:444.444.444.444 text text text
# Remove the line in file and modify the file# In macOS --> sed -i '' '/222.222.222.222/d' a.txt
$ sed -i '/222.222.222.222/d' a.txt
$ cat a.txt
ip:111.111.111.111 text text text
ip:333.333.333.333 text text text
ip:444.444.444.444 text text text
The text was updated successfully, but these errors were encountered:
POSIX compliant sed as typified by BSD sed etc. is used as standard in OS X etc, but sed used in general Linux is often GNU sed. Therefore, if Linux users use OS X's sed, they will be confused with so-called "dialect" like differences such as options.
I think this proxy server creation are mostly needed on Linux, so that the confusing "dialect" with sed command between macOS and Linux is not a big problem.
Linux Kernel/Distribution
Maybe by checking Linux distribution, we can "reject" user who want to create proxy server on macOS with this gem. Cause it is not a supporting OS.
# Kernel version
$ uname -a
$ cat /proc/version
# Distribution (/etc/os-release, /etc/system-release ...)
$ cat /etc/*-release
It is possible to use
sed
command to remove specific line which match desired patternhttps://www.gnu.org/software/sed/manual/sed.html
sed
Command UsageThe text was updated successfully, but these errors were encountered: