Re: Using BBEdit to `touch` files

2020-03-22 Thread GP
If you look at the documentation for Linux, Open Systems POSIX, MacOS, and 
FreeBSD versions of date, you'll find the MacOS and FreeBSD are pretty much 
exact duplicates.  What differences there may be look to be just 
differences between software versions.

Linux and POSIX look to be the same "slim" version of date. While the MacOS 
version should be able to execute a POSIX compliant date command, that 
version has quite a bit of added on bells and whistles.

On Saturday, March 21, 2020 at 4:51:07 PM UTC-7, Rod Buchanan wrote:
>
>
> My guess it is from macOS' BSD heritage.  Definitely not what I'm used to 
> on our Linux boxes, or what I remember (been a while) on AIX. 
>
>
> > On Mar 21, 2020, at 4:11 PM, @lbutlr > 
> wrote: 
> > 
> > On 21 Mar 2020, at 06:24, Rod Buchanan > 
> wrote: 
> >> date -j -v -99d +"%Y%m%d” 
> > 
> > That’s interesting, I’ve never seen that syntax for the date command. 
> > 
> > It’s less readable, but doesn't require gdate to be installed. 
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/562c7621-514d-4ad5-bbfd-fbaa9ee6a19a%40googlegroups.com.


Re: Using BBEdit to `touch` files

2020-03-21 Thread Rod Buchanan


My guess it is from macOS' BSD heritage.  Definitely not what I'm used to on 
our Linux boxes, or what I remember (been a while) on AIX.


> On Mar 21, 2020, at 4:11 PM, @lbutlr  wrote:
> 
> On 21 Mar 2020, at 06:24, Rod Buchanan  wrote:
>> date -j -v -99d +"%Y%m%d”
> 
> That’s interesting, I’ve never seen that syntax for the date command.
> 
> It’s less readable, but doesn't require gdate to be installed.
> 
> 
> -- 
> Advance and attack! Attack and destroy! Destroy and rejoice!
> 
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "supp...@barebones.com" 
> rather than posting here. Follow @bbedit on Twitter: 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to bbedit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/EF52148A-0383-47C2-9AFD-0E95DE32F7FD%40kreme.com.

-- 
Rod



-- 
Rod

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/4AA2CA8D-85C3-4719-B5C2-04239874CECF%40sofstats.com.


Re: Using BBEdit to `touch` files

2020-03-21 Thread @lbutlr
On 21 Mar 2020, at 06:24, Rod Buchanan  wrote:
> date -j -v -99d +"%Y%m%d”

That’s interesting, I’ve never seen that syntax for the date command.

It’s less readable, but doesn't require gdate to be installed.


-- 
Advance and attack! Attack and destroy! Destroy and rejoice!


-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/EF52148A-0383-47C2-9AFD-0E95DE32F7FD%40kreme.com.


Re: Using BBEdit to `touch` files

2020-03-21 Thread Rod Buchanan


I think the existing date command could have also given you what you want:

date -j -v -99d +"%Y%m%d"


> On Mar 21, 2020, at 12:59 AM, @lbutlr  wrote:
> 
> This might be useful to someone even though it is only tangentially related 
> to BBEdit. I spent quite a bit of time (let’s not talk about the hours I 
> spent trying to subtract 86,400 seconds from the current date in seconds 
> repeatedly. I did get it working, but egads!)  juggling bad ideas before I 
> came up with this solution.
> 
> I do quite a bit in the BBEdit shell worksheets and I often need to do is 
> touch files to update the date stamp and I have a situation where I have 
> several hundred files that I need to date stamp with today’s date, yesterdays 
> date, etc back for 3 years.
> 
> The file names are in the form “nn?n? Name of the file”
> 
> 1 name of file 1
> 2 name of file 2
> ...
> 99 name of file 99
> 100 name of file 100
> 
> And I need to execute a touch command along the lines of:
> 
> touch -t 20200420  "1 name of file 1"
> touch -t 20200419  "2 name of file 2"
> ...
> touch -t 20191222  "99 name of file 99"
> touch -t 20191221  "100 name of file 100”
> 
> This is the solution I came up with, finally. It does require that you 
> install dateutils on your Mac to get gdate (brew install dateutils)
> 
> touch -t `/usr/local/bin/gdate --date='today - 99 days' +'%Y%m%d’` "99 
> name of file 99”
> 
> It is trivial to replace the 99 with the index number of the file. If the 
> file doesn’t have an index number, you can use Text => Add/Remove Line 
> Numbers.
> 
> Hope this comes in handy for someone.
> 
> 
> -- 
> 'How come you know all that stuff?' 'I ain't just a pretty face.'
>   'You aren't even a pretty face, Gaspode.’
> 
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a feature 
> request or need technical support, please email "supp...@barebones.com" 
> rather than posting here. Follow @bbedit on Twitter: 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to bbedit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/D02D2F1F-9A58-4C00-8B98-EAABF5B3692E%40kreme.com.

-- 
Rod

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/C2740709-1D2D-40A5-AA7A-15CEC804A0A4%40sofstats.com.