So i'm running this command;
Code:
grep -f match.dat config > test.txt
and lets say I have another config file, say called config2... so now I've created a .sh file that looks like this
Code:
grep -f match.dat config > test.txt
grep -f match.dat config2 > test.txt
but the ">" character makes output of the 2nd line replace the output of the first instead of just adding to the file.. I would also like there to be a separator between the 2 outputs so I can clearly see where first ends and second starts.. lets say the output looks like this:
Code:
environment=${devel:env}
devel.ldapConfig.url=ldap\://155.165.192.12\:389
devel.ldapPool.timeBetweenEvictionRunsMillis=1234556
devel.ldapPool.initialPoolSize=2
devel.ldapPool.maxActiveConnections=2
and would like the test.txt file to look like this after both outputs are added:
Code:
-sh-3.2$ cat test.txt
config
environment=${devel:env}
devel.ldapConfig.url=ldap\://155.165.192.12\:389
devel.ldapPool.timeBetweenEvictionRunsMillis=1234556
devel.ldapPool.initialPoolSize=2
devel.ldapPool.maxActiveConnections=2
config2
environment=${devel:env}
devel.ldapConfig.url=ldap\://155.165.192.13\:389
devel.ldapPool.timeBetweenEvictionRunsMillis=777
devel.ldapPool.initialPoolSize=5
devel.ldapPool.maxActiveConnections=5
I'm definitely a newbie so any help would be appreciated, thanks!