devgirl
devgirl

Reputation: 783

Mac terminal command input too long it does not fit?

I need to run the command:

kubectl get pvc --field-selector metadata.name!=dataX********************************,******************************************************************,************************************************************************************************,************************************************************************************************,************************************************,*************************************************,***********************************************,*************************************************,***********************************************,*************************************************,***********************************************,************************************************,************************************************,*************************************************,***********************************************,*************************************************,dataY***********************************************,*************************************************,***********************************************,***************************************************,*********************************************,****************************************************,*******************************************,******************************************************,*****************************************,*******************************************************,****************************************,********************************************************,***************************************,*********************************************************,**************************************,**********************************************************,*************************************,***********************************************************,************************************,************************************************************,***********************************,************************************************************,***********************************,*************************************************************,***********************************,************************************************************,************************************,************************************************************,************************************,***********************************************************,*************************************,***********************************************************,*************************************,*************************************************************,***********************************,************************************************************,***********************************,*************************************************************,************************************,***********************************************************,*************************************,**********************************************************,**************************************,***********************************************************,************************************,************************************************************,***********************************,***********************************************************,************************************,*********************************************************,**************************************,********************************************************,***************************************,*******************************************************,***************************************,*******************************************************,*************************************,***********************************dataZ

however when I paste it in the mac terminal to run.. it only pastes till:

kubectl get pvc --field-selector metadata.name!=dataX********************************,******************************************************************,************************************************************************************************,************************************************************************************************,************************************************,*************************************************,***********************************************,*************************************************,***********************************************,*************************************************,***********************************************,************************************************,************************************************,*************************************************,***********************************************,*************************************************,dataY***********************************************,

I have hidden the actual data values.. but take the dataX dataY and dataX as examples...

Upvotes: 1

Views: 429

Answers (1)

Emon46
Emon46

Reputation: 1636

Can you try with script:

Write the command in a script file. like: test.sh.

And may be you need to add x mod also, to make it executable. just run the command to change the mod.

chmod +x test.sh

steps will be like this :

  1. nano test.sh.

  2. add the command inside the script.

  3. chmod +x test.sh.

  4. run ./test.sh

test.sh

#!/usr/bin/env bash

kubectl get pvc --field-selector metadata.name!=dataX********************************,******************************************************************,************************************************************************************************,************************************************************************************************,************************************************,*************************************************,***********************************************,*************************************************,***********************************************,*************************************************,***********************************************,************************************************,************************************************,*************************************************,***********************************************,*************************************************,dataY***********************************************,*************************************************,***********************************************,***************************************************,*********************************************,****************************************************,*******************************************,******************************************************,*****************************************,*******************************************************,****************************************,********************************************************,***************************************,*********************************************************,**************************************,**********************************************************,*************************************,***********************************************************,************************************,************************************************************,***********************************,************************************************************,***********************************,*************************************************************,***********************************,************************************************************,************************************,************************************************************,************************************,***********************************************************,*************************************,***********************************************************,*************************************,*************************************************************,***********************************,************************************************************,***********************************,*************************************************************,************************************,***********************************************************,*************************************,**********************************************************,**************************************,***********************************************************,************************************,************************************************************,***********************************,***********************************************************,************************************,*********************************************************,**************************************,********************************************************,***************************************,*******************************************************,***************************************,*******************************************************,*************************************,***********************************dataZ

then run ./test.sh in CLI.

Upvotes: 2

Related Questions