Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 49439

Questions specific to GNU’s Bourne Again SHell, as opposed to other Bourne/POSIX shells. For questions about Unix shells in general, use the /shell tag instead.

8
votes
Gdb's CLI supports a while loop. There's no builtin sleep command, but you can either call out to the shell to run the sleep program, or use gdb's builtin python interpreter, if it has one. It's inter …
answered Feb 8 '18 by Mark Plotnick
12
votes
for each command that you need to be interruptible with Ctrl-C: #!/bin/bash # make the shell (and its children) ignore SIGINT trap '' INT . . . # but this child won't ignore SIGINT (trap - INT; my_program) # the rest of the script is still ignoring SIGINT . . . …
answered Sep 10 '18 by Mark Plotnick
2
votes
If this is an assignment that requires writing a shell script, look at the other answers. But if you want to get periodic alerts, for birthdays or anything else, you can use the calendar command, whic …
answered Jul 29 '14 by Mark Plotnick
7
votes
Any practical usage of set -k is likely just personal style. Some - perhaps those who like programming languages that offer the ability to use keyword arguments in function calls, or those few people …
answered Apr 24 '14 by Mark Plotnick
3
votes
There isn't an option to sudo that will do exactly what you want, but you can make a shell function that will create a new command sudok, which will run the sudo command and then have sudo remove its …
answered Feb 25 '15 by Mark Plotnick
34
votes
There's a bash debugger, bashdb, which is an installable package on many distros. It uses bash's built-in extended debugging mode (shopt -s extdebug). It looks a lot like gdb; here's a sample session …
answered Sep 15 '14 by Mark Plotnick
1
vote
You can use the write utility to send text to a specific logged-in user. command that produces output | write root The documentation further explains: To write to a user who is logged in more …
answered Oct 2 '15 by Mark Plotnick
5
votes
specified function gets called, and most shells do catch it. Bash will react to a SIGHUP by sending SIGHUP to each of its background processes (except those that have been disowned). Looking at your … will immediately exit. ─gnome-terminal(31486)─bash(31494)──gedit(31530) [31486] getpgid(0x7b06) = 31494 [31486] kill(-31494, SIGHUP) = 0 [31494] --- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid …
answered Dec 31 '14 by Mark Plotnick
4
votes
stty susp undef will disable the keyboard-initiated suspend signal for most programs, however commands like vim and emacs that have specific bindings for Ctrl-Z will have to be reconfigured individual …
answered Jun 18 '14 by Mark Plotnick
17
votes
Let's look more closely at what's happening to less: $ pdfgrep -R -i spark . | strace less & [...] open("/dev/tty", O_RDONLY|O_LARGEFILE) = 3 ioctl(3, TCGETS, {B38400 opost isig -icanon -echo ...}) …
answered Oct 8 '17 by Mark Plotnick
6
votes
If your sort can do a stable sort, e.g. GNU sort with the -s or --stable option, lines with fields unrelated to the sort keys will not be sorted by those fields when there are ties, but will stay in t …
answered Nov 28 '15 by Mark Plotnick
8
votes
the screen and ran fortune. Other shells adopted these same features. ksh would read in ~/.kshrc, bash would read in ~/.bashrc, and those were where you'd place your alias definitions. So, to make a …
answered Feb 7 '14 by Mark Plotnick
5
votes
On Linux systems that have GNU coreutils installed, or on FreeBSD >= 8.3: In a shell script, call readlink -f "$0" to find the canonical pathname of the script, which will resolve any symlinks. Call …
answered Dec 22 '14 by Mark Plotnick
0
votes
One way to do this is with the following steps: get width of terminal find the longest line in the ASCII art file take the difference between those numbers and divide by 2 to get the needed indentat …
answered Nov 9 '17 by Mark Plotnick
20
votes
It works the way it does because Unix is full-duplex. As Ritchie said in The UNIX Time-sharing System: A Retrospective: One thing that seems trivial, yet makes a surprising difference once one is …
answered Jan 13 '15 by Mark Plotnick

15 30 50 per page