write shell script or other script on vCenter

Solution 1:

You don't write scripts directly on vCenter. It has an API, there are libraries to access the API for many scripting languages. Pick a language of your choice, read it's documentation and write your script on any host you like.

Solution 2:

You can use Vmware's PowerCLI tool.

From Vmware,

VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell, and provides more than 800 cmdlets for managing and automating VMware vSphere, VMware Cloud Director, vRealize Operations Manager, vSAN, VMware NSX-T Data Center, VMware Cloud Services, VMware Cloud on AWS, VMware HCX, VMware Site Recovery Manager, and VMware Horizon environments.

You can also use it on Linux workstations, after installing Powershell for Linux. Probably the commands/cmdlets added to powershell by PowerCLI can help you script whatever you need.