Merge files via Script

maiksanftenberg
Contributor II

Hey.
I'm facing a small issue that I want to fix.
We deploy VMWare Fusion and Virtual machines via Self Service.

Under /Library/Application Support/VMware/VMware Fusion/Shared it saves a file called vmInventory that lists the virtual machines that are shared on the local machine (as they are located in the /Users/Shared/VM folder.

Once a VM is added to the system via Self service I would like to add them to the file automatically.

cat xxx > vmInventory is not working as it not combines both files rather then overwriting the content of the existing vmInventory.

Any other idea?

Thanks in advance.

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III

To add to a file you use >> not >. The single character will overwrite. Double will append.

View solution in original post

2 REPLIES 2

mm2270
Legendary Contributor III

To add to a file you use >> not >. The single character will overwrite. Double will append.

maiksanftenberg
Contributor II

Thanks Mike.
That done the trick. I only found > on the net.

Cheers