xdg-openコマンドをエスケープするURLとシンボル

xdg-openコマンドをエスケープするURLとシンボル

コマンドを使用してURLを開こうとしましたが、&xdg-open文字をエスケープしてみましたが、bashでは可能なすべてのオプションは機能しません。

私は次を試しました

xdg-open "https://google.co.in?q=cream" <-works fine as desired
xdg-open "https://google.co.in?q=cream&as_epq=cream+here" <- problem arises here due to ampersand

次の方法で脱出しようとしました。

xdg-open "https://google.co.in?q=cream\&as_epq=cream+here"
xdg-open "https://google.co.in?q=cream^&as_epq=cream+here"
xdg-open "https://google.co.in?q=cream%26as_epq=cream+here"
xdg-open "https://google.co.in?q=cream&amp;as_epq=cream+here"
xdg-open "https://google.co.in?q=cream\&amp;as_epq=cream+here"
xdg-open "https://google.co.in?q=cream+%26+as_epq=cream+here"
xdg-open "https://google.co.in?q=cream&&as_epq=cream+here"

https://google.co.in?q=cream&as_epq=cream+hereいずれにせよ、応答はブラウザにURLを入力したときと似ています。

xdg-openを実行して&シンボルをエスケープする正しい方法を見つけるのに役立ちます。

ベストアンサー1

おすすめ記事