小编Ger*_*rez的帖子

Bash脚本打印命令,但不打印echo命令

我想写一个打印命令的bash脚本.但出于可读性目的,我不希望它打印echo命令.不幸的是,我找不到正确的bash脚本设置来实现这一点.我需要帮助?

#!/bin/bash

# Makes the bash script to print out every command before it is executed
set -v

echo "Cleaning test database"
RAILS_ENV=test bundle exec rake db:drop
echo "************************************************************"
echo ""

echo "Setting up the test database"
RAILS_ENV=test bundle exec rake db:setup
echo "************************************************************"
echo ""
Run Code Online (Sandbox Code Playgroud)

输出如下:

echo "Cleaning test database"
Cleaning test database
RAILS_ENV=test bundle exec rake db:drop
echo "************************************************************"
************************************************************
echo ""


echo "Setting up the test database"
Setting up the test database
RAILS_ENV=test bundle exec rake db:setup …
Run Code Online (Sandbox Code Playgroud)

bash command-line echo

7
推荐指数
2
解决办法
5627
查看次数

以编程方式将新路由添加到 zuul 代理

我正在使用带有@EnableZuulProxy注释的 Spring Boot 应用程序。但我想在运行时添加自定义路由。这怎么可能?

现有文档仅显示静态示例,其中路由在application.yml. 您能否指出我的用例的代码片段。

ZuulConfiguration我发现添加路由的可能性,routeLocator().getRoutes().add(route);但它们不适用于运行时。我错过了什么?

非常感谢。干杯

杰拉尔多

routing spring spring-boot netflix-zuul

6
推荐指数
1
解决办法
2637
查看次数

标签 统计

bash ×1

command-line ×1

echo ×1

netflix-zuul ×1

routing ×1

spring ×1

spring-boot ×1