同时发送两个命令telegram-cli

时间:2018-07-01 16:09:03

标签: command telegram

我有错误:

## questions_controller.rb

class QuestionsController < ApplicationController
  before_action :set_question, only: [:show, :edit, :update, :destroy]
  def index
    @questions = Question.all.page(params[:page]).per(20)
  end

  def show
    @question = Question.find(params[:id])

  end

  def new
    @question = Question.new

  end

  def edit
    @question = Question.find(params[:id])
  end

  def create
    @question = current_user.questions.build(question_params)
    respond_to do |format|
      if @question.save
        format.html {
          redirect_to @question
          flash[:success] = "success"
        }
        format.json { render :show, status: :created, location: @question }
      else
        format.html { render :new }
        format.json { render json: @question.errors, status: :unprocessable_entity }
      end
    end
  end


  def update
    respond_to do |format|
      if @question.update(question_params)
        format.html {
          redirect_to @question
          flash[:success] = "success"
        }
        format.json { render :show, status: :ok, location: @question }
      else
        format.html { render :edit }
        format.json { render json: @question.errors, status: :unprocessable_entity }
      end
    end
  end

  def destroy
    @question.destroy
    redirect_to index
  end

  private
    def set_question
      @question = Question.find(params[:id])
    end

    def question_params
      params.require(:question).permit!
    end
end

我测试过:

\ n

\\ n

;

|

||或&&

您可以同时执行两个命令吗?

Thx

1 个答案:

答案 0 :(得分:0)

尝试使用管道:

echo "msg XXX YYY"$'\n'"msg XXX ZZZ" |./telegram-cli -W -.......