~ubuntu-branches/ubuntu/trusty/abs-guide/trusty-proposed

« back to all changes in this revision

Viewing changes to abs/ex69.sh

  • Committer: Package Import Robot
  • Author(s): Sandro Tosi
  • Date: 2012-06-03 10:57:27 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20120603105727-rm7frl4feikr2swm
Tags: 6.5-1
* New upstream release
* debian/watch
  - updated
* debian/abs-guide.lintian-overrides
  - updated for new upstream code
* debian/control
  - bump Standards-Version to 3.9.3 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
# Noninteractive use of 'vi' to edit a file.
4
 
# Emulates 'sed'.
5
 
 
6
 
E_BADARGS=85
7
 
 
8
 
if [ -z "$1" ]
9
 
then
10
 
  echo "Usage: `basename $0` filename"
11
 
  exit $E_BADARGS
12
 
fi
13
 
 
14
 
TARGETFILE=$1
15
 
 
16
 
# Insert 2 lines in file, then save.
17
 
#--------Begin here document-----------#
18
 
vi $TARGETFILE <<x23LimitStringx23
19
 
i
20
 
This is line 1 of the example file.
21
 
This is line 2 of the example file.
22
 
^[
23
 
ZZ
24
 
x23LimitStringx23
25
 
#----------End here document-----------#
26
 
 
27
 
#  Note that ^[ above is a literal escape
28
 
#+ typed by Control-V <Esc>.
29
 
 
30
 
#  Bram Moolenaar points out that this may not work with 'vim'
31
 
#+ because of possible problems with terminal interaction.
32
 
 
33
 
exit