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 about shell scripts, executable files that are interpreted by a shell (bash, zsh, etc.).

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
2
votes
Make can read a makefile from stdin, so you can give it a here document that is a makefile. The following is a makefile that includes your kernel makefile and adds a new wildcard target, %.var, whose …
answered Mar 29 '15 by Mark Plotnick
2
votes
A typical way to do this is to use the trap command to tell the shell script to ignore SIGINT (generated by Control-C), and then to re-enable SIGINT in a subshell just before your command is run. tra …
answered Aug 27 '15 by Mark Plotnick
3
votes
The following script ought to do an outer join on column (field) 1 of all the tab-delimited files passed as arguments. It uses the join command, which does an outer join on sorted files, 2 files at a …
answered Jan 3 '15 by Mark Plotnick
78
votes
Most standard shells provide a way to do simple text substitution within shell variables. http://tldp.org/LDP/abs/html/parameter-substitution.html explains as follows: ${var/Pattern/Replacement} Fir …
answered Nov 26 '13 by Mark Plotnick
31
votes
When bash is called with the name sh, it does this: if (shell_name[0] == 's' && shell_name[1] == 'h' && shell_name[2] == '\0') act_like_sh++; and then later sets the POSIXLY_CORRECT shell varia …
answered Aug 13 '18 by Mark Plotnick
2
votes
Assuming these windows file systems are the cifs mount type, mount -a -t nocifs mount -a -F -t cifs This will mount all non-cifs filesystems, then mount all cifs filesystems in the background and r …
answered Dec 7 '13 by Mark Plotnick
2
votes
$ eval echo -e "n\ $d/$prf.00{2..$last}.tar\\\n" n someprefix.002.tar n someprefix.003.tar n someprefix.004.tar How did that whitespace get in there? The answer in a nutshell: this is analogo …
answered Nov 28 '14 by Mark Plotnick
1
vote
printf -- " Time TPS\n" sed 's/,.*//' < inputfile | # extract just the date-time sort | uniq -c | # field 1 is now the count of each line's occurrences awk '{ print …
answered Mar 14 by Mark Plotnick
1
vote
The mv command can do a variety of things depending on the types of its arguments, and there are some cases where it might not be able to do exactly what you want. It doesn't really handle merging two …
answered Nov 25 '15 by Mark Plotnick
5
votes
This is typically done using the tcsendbreak C library routine. You can get to this from the shell by using a Python or Perl one-liner: python -c 'import termios; termios.tcsendbreak(3, 0)' 3>/dev/yo …
answered Jan 21 '16 by Mark Plotnick
7
votes
If your terminal emulator supports ANSI escape sequences, you can move the cursor up by running this: echo -n -e '\033[2A' or ruby -e 'print "\033[2A"' This will move the cursor up 2 lines. It w …
answered Jan 1 '14 by Mark Plotnick
1
vote
According to the shell standards document, tilde expansion is supposed to take place when a shell variable is assigned if the tilde is at the beginning of a word or follows an unquoted colon. So it's …
answered Feb 10 '14 by Mark Plotnick
2
votes
Bash, ksh93, zsh, and other recent shells support process substitution (the <(command) syntax), but it is a non-standard extension. Dash (which is /bin/sh on Ubuntu systems) doesn't support it, and ba …
answered Jan 8 '15 by Mark Plotnick
4
votes
FILES=$(command) is going to set a variable named FILES to a scalar that contains the output of command. ${FILES[0]} is going to be the contents of that scalar variable, in your case, a string contai …
answered Feb 5 '14 by Mark Plotnick

15 30 50 per page