Mac terminal command input too long it does not fit?

冷暖自知 提交于 2021-02-10 21:12:30

问题


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...

  • whole command has total 536

  • it only pastes 185

  • now how do I fit all the terminal?


回答1:


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.



来源:https://stackoverflow.com/questions/65988112/mac-terminal-command-input-too-long-it-does-not-fit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!