#!/usr/bin/env fctool # usage: # $ ./userinfo.fctool username=alice %[columns] username password id group info homedir shell [/] %if {file == ""} file = stdout %endif %if {username == ""} username = {input("username: ")} %endif [{file}] %for userline : {$["/etc/passwd"]} userline_name = {nth(userline, colon, 0)} %if {userline_name == username} %for column : {colon} : {userline} {nth(columns, column_i)} {column} %endfor {exit} %endif %endfor user {username} not found