Skip to content

Commit

Permalink
Ensure that tail works
Browse files Browse the repository at this point in the history
The following ensures that tail works in all contexts. Missing -n
will fail as +2 isn't supported in all environments.
  • Loading branch information
SimonRichardson committed Mar 6, 2019
1 parent c921859 commit 2d55b89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion service/snap/snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func SetSnapConfig(snap string, key string, value string) error {
// to produce a list of currently-installed services that are managed by snap.
func ListCommand() string {
// filters the output from `snap list` to only be a newline-delimited list of snaps
return Command + " services | tail +2 | cut -d ' ' -f1 | sort -u"
return Command + " services | tail -n +2 | cut -d ' ' -f1 | sort -u"
}

// ListServices returns a list of services that are being managed by snap.
Expand Down

0 comments on commit 2d55b89

Please sign in to comment.