[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: is it normal that ${var:-~/path} doesnt resolve ~ to $HOME
From: |
Chet Ramey |
Subject: |
Re: is it normal that ${var:-~/path} doesnt resolve ~ to $HOME |
Date: |
Tue, 15 Nov 2022 11:48:51 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 |
On 11/15/22 11:44 AM, Alex fxmbsw7 Ratchev wrote:
xmb@lt:~$ cat fix.IrcLog
#!/bin/bash
sed -ri -e '/Unable to/d' -e '/refnum 0\]/d' "${1:-~/IrcLog}"
xmb@lt:~$ bash fix.IrcLog
sed: can't read ~/IrcLog: No such file or directory
Double quotes inhibit tilde expansion.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/