実行可能ファイルに接続していくつかのパラメータを削除する

実行可能ファイルに接続していくつかのパラメータを削除する

私は現在Xamarin Studioを使用していますが、このバージョンにはバグがあります。実行可能ファイルに2つのパラメータを追加することで、出力にエラーメッセージがあふれ、ビルド時間が1分から少なくとも10分に遅くなりました。

元の実行可能ファイルを移動し、問題のある2つのパラメータを削除して元の場所に配置するbashスクリプトまたはリンクを作成する方法はありますか?

したがって、Xamarinは通常どおりコマンドを実行しますが、問題のある2つのパラメータは元のコマンドに渡されません。

はい/usr/bin/ibtool --errors --warnings --notices --output-format xml1 --minimum-deployment-target 7.0 --target-device iphone --target-device ipad --auto-activate-custom-fonts --sdk iPhoneSimulator9.0.sdk --compilation-directory Main.storyboard、私が望むものは次のとおりです。

  1. ibtool移動するibtool_orig
  2. リンクまたはスクリプトを入力すると、ibtool問題のパラメータが削除され、それをに渡してibtool_orig 次のコマンドを提供します。

/usr/bin/ibtool_orig --errors --output-format xml1 --minimum-deployment-target 7.0 --target-device iphone --target-device ipad --auto-activate-custom-fonts --sdk iPhoneSimulator9.0.sdk --compilation-directory Main.storyboard(今ibtoolは消えibtool_origたので参考にしてください--errors --warnings

どんなアイデアがありますか?

ベストアンサー1

正式な方法は、次のような形状のループです。

#! /bin/sh -
for i do # loop over the positional parameters
  case $i in
    --notices|--warnings) ;;
    *) set -- "$@" "$i" # append to the end of the positional parameter
                        # list if neither --notices nor --warnings
  esac
  shift # remove from the head of the positional parameter list
done
exec "${0}_orig" "$@"

または、 path#! /bin/sh -に置き換えることも、pass as に置き換えることもできます(エラーメッセージで使用するか、それ自体を再実行できます)。kshzshyashbashexecexec -a "$0"ibtool_orig/path/to/ibtoolargv[0]

おすすめ記事