To paste contents of two files horizontally, paste command can be used.
 Create a file called cmd with the following content:
 # cat cmd
 /usr/sbin/useradd
 /usr/sbin/useradd
 /usr/sbin/useradd
Create another file called newusers
 # cat newusers
 tom
 dick
 harry
Now run the following command
 # paste -d ” ” cmds newusers > add.sh
The -d ” ” seperates the contents by single space insetad of a tab. Check the final output
 # cat add.sh
 /usr/sbin/useradd tom
 /usr/sbin/useradd dick
 /usr/sbin/useradd harry
- Previous Post - Find empty files in Linux
- Next Post - Create strong passwords in Unix
 
  
  
 
