Skip to content

Tag: macos

Get specific day of week of the upcoming Canada day on Linux

How to use cal command to add the calendar of next July to the end of the file, for example, myfile, and what day of the week the upcoming Canada Day fall on? So far I just have this command: I feel like I am not doing it correct and I don’t know which command to use, to find the

Using sed with regex to replace text on OSX and Linux

I am trying to replace some strings inside a file with sed using Regular Expressions. To complicate the matter, this is being done inside a Makefile script that needs to work on both osx and linux. Specifically, within file.tex I want to replace with (xxx and yyy are just example text.) Note, xxx could contai…

Makefile as simlink: not found

Is it possible to have a Makefile referenced by a simlink, and try calling action using make? I am experiencing that calling make in a directory where Makefile is a simlink, Makefile is not found. I have a need to reduce replication of Makefiles, and I would prefer using simlinks. Suggestions? Answer It shoul…

Extract part of string in Bash

When I import my GPG keys, I get a response back: I would very much like to extract the key’s ID LOL12345. The command I run that returns the output is as follows: Answer Try to use grep: -P use perl regex style. -o print only the matched part. -m 1 exit after the first match. This will ensure, that