summaryrefslogtreecommitdiff
path: root/tests/fake-editor-change-password.sh
blob: bfae8e1d9f637b65d234a8ac4d625cdb6b2087bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# Fake editor program for testing 'pass edit'.
# Changes password to 'Hello World', leaving rest of file intact.
#
# Intended use:
#   export FAKE_EDITOR_PASSWORD="blah blah blah"
#   export EDITOR=fake-editor-change-password.sh
#   $EDITOR <password file>
#
# Arguments: <filename>
# Returns: 0 on success, 1 on error

if [[ $# -ne 1 ]]; then
	echo "Usage: $0 <filename>"
	exit 1
fi

filename=$1 ; shift ;
new_password="${FAKE_EDITOR_PASSWORD:-Hello World}"

# And change only first line of file
# -i.tmp allows editing file in place. Extension needed on Mac OSX
sed -i.tmp "1 s/^.*$/$new_password/g" "$filename"

exit 0
an>New plugin system - first hackRené 'Necoro' Neumann2-420/+683 2008-06-30Now the new design is able to do the same as the old oneRené 'Necoro' Neumann3-168/+182 2008-06-30First draft of the new plugin windowRené 'Necoro' Neumann1-8/+172 2008-06-30Added stuff to plugin.pyRené 'Necoro' Neumann1-2/+24 2008-06-25Now load 22 versions when running the correct portageRené 'Necoro' Neumann4-8/+18 2008-06-25Added Package_22 and System_22René 'Necoro' Neumann4-5/+63