Skip to main content
Answer

Merge files via Script

  • May 22, 2013
  • 2 replies
  • 11 views

Forum|alt.badge.img+9

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.

Best answer by mm2270

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

2 replies

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • Answer
  • May 22, 2013

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


Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • May 22, 2013

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

Cheers