以下の方法で変数を展開する方法はありますか? この場合
X=$(date --date=yesterday +%Y-%m-%d)
echo $X #--> 2012-07-26
以下のコマンドは機能しますが、日付が 25 であっても $X
null と見なされ、 picks と見なされます*
。その変数をその場で展開する具体的な方法はありますか?
find . -maxdepth 1 -type f -regex '.*\(/\asyncprocessor.log.'$X'*\|/Renewal.log.'$X'*\|/Scheduler.log.'$X'*\|/smsprocessor.log.'$X'*\|/Subscription.log.'$X'*\).*' -exec ls -ltr {} \;