From 4f54da3795e90128b1efa0b4a956f2e3878b8d9e Mon Sep 17 00:00:00 2001 From: axel Date: Mon, 2 Feb 2009 08:19:21 +1000 Subject: Fix user completion so it can handle comments in the passwd file. Patch by Sven Axelsson. darcs-hash:20090201221921-ac50b-ef0883afe4dc68b43c1c705d49b6b5505dbf1e73.gz --- share/functions/__fish_complete_users.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/functions/__fish_complete_users.fish') diff --git a/share/functions/__fish_complete_users.fish b/share/functions/__fish_complete_users.fish index a804ec02..e3ca35f4 100644 --- a/share/functions/__fish_complete_users.fish +++ b/share/functions/__fish_complete_users.fish @@ -1,4 +1,4 @@ function __fish_complete_users --description "Print a list of local users, with the real user name as a description" - cat /etc/passwd | sed -e "s/^\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):.*/\1\t\2/" + cat /etc/passwd | grep -ve '^#' | sed -e 's/^\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):.*$/\1'\t'\2/' ^/dev/null end -- cgit v1.2.3