Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 43 lines (41 sloc) 1.491 kB
#!/usr/bin/env sh
#
# NAME
# join-lines.sh - Join previously split vCard lines
#
# SYNOPSIS
# join-lines.sh FILE...
#
# DESCRIPTION
# Simply removes any occurrences of the sequence CR, LF, space.
#
# Can be used as a preprocessing script for vCard handling.
#
# BUGS
# https://github.com/l0b0/vcard/issues
#
# COPYRIGHT
# Copyright (C) 2012 Victor Engmark
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
sed -n '
1h # Replace the hold space with the first line
1!H # Append following lines to the hold space
${ # If this is the last line
g # Use the multiple accumulated lines
s/\r\n //g # Remove any line splits
p # Print the result
}' "$@"
Jump to Line
Something went wrong with that request. Please try again.