# Script to copy a text to clipboard of macOS devices

Using Hexnode, the admin can [deploy a script](https://www.hexnode.com/mobile-device-management/help/how-to-run-scripts-on-mac-using-hexnode-mdm/) to copy a given text to the clipboard of the target systems. Once the text is copied, the user can paste it multiple times at different places. The text will be stored in the clipboard till another text is copied.

Scripting Language – Bash

File extension – .sh

 Disclaimer:The Sample Scripts provided below are adapted from third-party Open-Source sites.

 

Copy text to Clipboard
----------------------

Script to copy text to clipboard

\#!/bin/bash echo Content to be copied to clipboard | pbcopy 

   1

2

  \#!/bin/bash 

echo Content to be copied to clipboard | pbcopy 

   

 

  

 Notes:- It is recommended to manually validate the script execution on a system before executing the action in bulk.
- Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.