New answers tagged

1 vote

Terminal is not fully functional warning with less but not with more (which is also less)

The same program can behave differently if it is being run with different parameters: in your first command it receives argv[] = {"less", NULL} as the command-line argument array, while the ...
user1686's user avatar
  • 415k
2 votes

How do I delete every ocurrence of a word that is followed by another, without altering the whitespace?

With anything which supports perl-compatible regular expressions (PCRE), you can use a positive lookahead: perl -pe 's/foo(?=.*bar)//' < txt (?=) is a "zero-width positive lookahead assertion&...
jcaron's user avatar
  • 1,718
3 votes

How do I delete every ocurrence of a word that is followed by another, without altering the whitespace?

OK, I found out how to do this. The command to do this with sed would be: sed -i -E 's/foo([[:blank:]]*)bar/\1bar/' file
vim_overlord's user avatar
0 votes

Shell unbuffering for CygWin: is it possible?

Use stdbuf. It is on cygwin in the coreutils package.
Astara's user avatar
  • 649
2 votes

Variables not being set in Makefile

You need to remember that the "makefile" part of make, is separate from the "shell" part. Once you're inside the recipe for the makefile it's all shell commands. That means you ...
maxprehl's user avatar
1 vote
Accepted

Unix cat and zip together

From zip(1) - Linux man page : zip also accepts a single dash ("-") as the name of a file to be compressed, in which case it will read the file from standard input, allowing zip to take ...
harrymc's user avatar
  • 445k
0 votes

Unix cat and zip together

This probably isn't what you really want but you can do this. mkfifo zip.pipe # create fifo cat File2022*.txt > zip.pipe & # pipe data to fifo, in background zip --fifo ...
doneal24's user avatar
  • 633
1 vote
Accepted

Running shell Script via Crontab

Use > cron.log 2>&1 to have the cronjob write its output to a file, so that you could see the error messages it produces. (Some cron daemons automatically write the output to syslog when ...
user1686's user avatar
  • 415k
1 vote
Accepted

Change the default location of zsh completion cache files for macOS

Update and fix. I've updated my code to the following to fix the issue of two dump files being created. ZSH_COMPDUMP="$HOME/.cache/zsh/zcompcache" # Create the parent directory if it doesn'...
LukeMA82's user avatar
0 votes

How do I automate borg backup?

borgmatic was created for exactly this purpose and is a wrapper around brog. Create a .yaml config file, and then run borgmatic. Follow this cron guide and you're good to go.
Peter V. Mørch's user avatar
3 votes
Accepted

How to split a string (of arguments) in fish?

Another way to do it would be: echo "--r -run" | string split " " So piping the string into that command.
Destroy666's user avatar
  • 2,605
3 votes

How to split a string (of arguments) in fish?

I got it working, chatGPT answer: By using -- after the " " delimiter in the string split command, we ensure that the shell treats everything after -- as a regular argument and does not ...
RHOOPH's user avatar
  • 85
0 votes

Cannot open Jupyter Notebook in the new zsh shell in macOS

The issue is to do with the '.bash_profile' file not being recognised by Zsh. Instead Zsh needs a '.zshrc' file. To fix simply follow these steps: Open Finder and navigate to /Users/{YourUser}/ Press ...
alpacinohead's user avatar
0 votes
Accepted

ProxyJump not running ForceCommand defined in sshd_config

ProxyJump does not run a ForceCommand because it does not run any command at all – it does not open any interactive shell session, only a TCP tunnel (similar to the -L or -W options). The only thing ...
user1686's user avatar
  • 415k
1 vote

How can I kill Firefox by console?

Try: $ kill $(ps -x | grep firefox | awk '{print $1}') This command kills all firefox instances. From this website: link
Stephen Rodriguez's user avatar
0 votes
Accepted

zsh completion ( compctl ) does not trig for command names containing dashes

Got it confirmed in the zsh-workers@zsh.org mailing-list that this is a bug and got a suggested patch: --- zsh-5.9.orig/Src/Zle/zle_tricky.c +++ zsh-5.9/Src/Zle/zle_tricky.c @@ -1315,6 +1315,8 @@ ...
frax's user avatar
  • 46
0 votes

tee for Windows?

Native port of tee for Windows also exists, for example: https://github.com/dEajL3kA/tee-win32/tree/master#tee-for-windows
lirisa8564's user avatar

Top 50 recent answers are included