1
シェルから部分文字列を抽出したい。これは一例です:bash内の部分文字列を取得する方法
[email protected]:~$ var=$(curl -s 'https://www.youtube.com/')
[email protected]:~$ echo $var|grep -ob GetBrowse_rid
[email protected]:~$ 50000:GetBrowse_rid
[email protected]:~$ echo $var|grep -ob what_to_watch
[email protected]:~$ 55555:what_to_watch
[email protected]:~$ echo ${var:50000:55555}
は、私が "GetBrowse_rid" と "what_to_watch" beetwenテキストを抽出したいのですが、何らかの理由で私のコードではない
が
*それは何をするのですか、そうでなければ何を期待していましたか? – chepner