Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid AWS CLI to wait on --More-- prompt

I am automating app deployments by making use of AWS CLI commands. However, the problem is that when the AWS command is fired and is completed, the next command in the script is not executed. This is because the command returns a JSON and that JSON doesn't display whole at a time. It displays partial and then a --More-- prompt appears. Only when the user presses Enter (or may be any other key), then only the rest of the JSON is displayed. If the JSON returned is large, this process (of pressing Enter) is to be repeated many times.

Example:

aws lambda create-function --function-name testFunction --zip-file fileb://testFunction.zip --handler testFunction.lambda_handler --runtime python3.9 --role arn:aws:iam::413124763983:role/LambdaAccessRole\n\n
{
    "FunctionName": "testFunction",
    "FunctionArn": "arn:aws:lambda:us-east-1:413124763983:function:testFunction",
    "Runtime": "python3.9",
    "Role": "arn:aws:iam::413124763983:role/LambdaAccessRole",
    "Handler": "testFunction.lambda_handler",
    "CodeSize": 986,
    "Description": "",
    "Timeout": 3,
    "MemorySize": 128,
    "LastModified": "2022-11-28T03:39:11.017+0000",
    "CodeSha256": "moRVatK9khJOLTbPzq8zrGB989nBhfMiV1GCx5pNr2o=",
    "Version": "$LATEST",
-- More --

As can be seen above, there is a --More-- prompt at after partial JSON is displayed.

How can I avoid this --More-- prompt and simply display entire JSON so that next command in the script is executed?

like image 268
SimpleGuy Avatar asked Nov 16 '25 15:11

SimpleGuy


1 Answers

I prefer adding --no-cli-page to the end of my commands. This makes my scripts more portable.

like image 51
baynezy Avatar answered Nov 18 '25 08:11

baynezy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!