On Sat, Jul 20, 2024 at 8:57 AM Mark Liam Brown wrote: Basically I need every bit of information out of "net use", "net > config", "net statistics", "net view" and so on, parse it in bash or > perl, process it in bash, and output it in JSON format from the bash > script for our (Linux-based) admin report interface. >
The 'net use' command output is not designed for parsing. For example, the 'net user' command outputs usernames in separate columns, and truncates usernames that are longer than some number of characters (I forget how many), so it's not a reliable source of truth anyway. You will need to get the information a different way. As has been mentioned, on the Windows platform, the best approach would be to use PowerShell rather than trying to perform parsing on output that's not designed to be parsed in the first place. Bill -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple