Skip to content

Commit b3d5d0c

Browse files
committed
Replace with more idiomatic wc -l.
1 parent 0fc3804 commit b3d5d0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

command-not-found.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ command_not_found_handle () {
1717
toplevel=nixpkgs # nixpkgs should always be available even in NixOS
1818
cmd=$1
1919
attrs=$(@out@/bin/nix-locate --minimal --no-group --type x --type s --whole-name --at-root "/bin/$cmd")
20-
len=$(echo -n "$attrs" | grep -c "^")
20+
test "${attrs}" && len=$(echo "$attrs" | wc -l) || len=0
2121

2222
case $len in
2323
0)

0 commit comments

Comments
 (0)