linux command to create a linux user (db2 authorize base on linux os user)

useradd user_name
passwd user_name





db2 connect to datbase_namedb2 -tnx "select distinct 'GRANT select ON TABLE '||'\"'||rtrim(tabschema)||'\".\"'||rtrim(tabname)||'\" TO USER user_name;' from syscat.tables where tabschema = 'schema_name' " >> grants.sql
db2 -tvf grants.sql

note: remember to chmod grants.sql to 775 or 777