bashパスで/を変更したいです。

bashパスで/を変更したいです。

/ を path/test/path/ から /replace に変更したいと思います。

つまり、予想される出力は =test=path=to=replace でなければなりません。

ベストアンサー1

#! /usr/bin/env bash

A="/test/path/to/replace"
B="${A////=}"
echo "$B"

結果:

=test=path=to=replace

おすすめ記事