Creating files with lists of z/VM user IDs
You can use Linux™ commands to obtain lists of z/VM® user IDs.
You might need lists of z/VM user IDs to specify:
- Target systems that
ts-shellcan connect to - Target systems a particular user can connect to
- Target systems for which session logs are to be created
- A z/VM filter file
Such lists can be extensive and writing them manually is both tedious and error prone. If you have access to the z/VM user directory, and your z/VM user IDs follow a naming convention, you can use the vmur, grep, and cut commands to create a list from the z/VM user directory.
The grep and cut commands are core Linux commands. The vmur command is included in the s390-tools package.
Example: This example is
based on the following assumptions:
- The z/VM user directory has been sent to the reader of your z/VM guest virtual machine.
- You want to list all z/VM user IDs that begin with LINUX and end with one or more numerals.
[root]# vmur receive -H -t 1234 -O |grep -E "^USER LINUX[0-9]+" |cut -d" " -f2 > userlist
The
individual parts of this command perform these tasks:
- The vmur command reads out the file with spool ID 1234 from the reader.
- The grep command extracts all lines that specify z/VM user IDs according to the pattern.
- The cut command reduces the line to just the z/VM user ID.
- The greater than symbol (>) directs the output to a file,
userlist.
You can find out the spool IDs of the files in your z/VM reader with the command:
[root]# vmur list -q rdr
Tip: Another convenient way to create lists of IDs that follow
a pattern is bash brace expansion. For example, to create a list of
IDs including
lnxa34 through lnxa46, lnxb34 through lnxb46,
and lnxc34 through lnxc46 enter: $ echo lnx{a..c}{34..46} | tr ' ' '\n'