File: cfg_edit.sh

package info (click to toggle)
lynx 2.8.9dev11-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,556 kB
  • ctags: 12,873
  • sloc: ansic: 133,772; sh: 3,560; makefile: 1,139; perl: 995; yacc: 743
file content (17 lines) | stat: -rwxr-xr-x 512 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# Invoked from cfg_defs.sh as a filter
# Strip leading and trailing whitespace
# Escape any iternal '\'
# Escape any iternal '"'
# Entify any iternal '&', '<' or '>'
# Append a '=' if none present'
# Break into two strings at '='
# Prefix ' { "' and suffix '" },'
LC_ALL=C sort |
sed	-e 's!^[ 	]*!!' -e 's![ 	]*$!!' \
	-e 's!\\!\\\\!g'        \
	-e 's!"!\\"!g'          \
	-e 's!&!\&amp;!g' -e 's!<!\&lt;!g' -e 's!>!\&gt;!g' \
	-e 's!^[^=]*$!&=!' \
	-e 's!=!",	"!'     \
	-e 's!^!	{ "!' -e 's!$!" },!'