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 6167

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.

3
votes
Try this: variable="3 things" if echo "$variable" | grep "^[0-9]\{1,\}" >/dev/null 2>&1 #if $variable begins with [0-9] then echo "$variable" | sed 's/ .*$//' else echo "0" fi When using th …
answered Apr 28 '11 by penguin359
6
votes
"%.3e\n" 2923174917395723957 2.923e+18 Some shells like bash have a built-in called printf which may be different from any printf command that comes with the system, but, in general, you shouldn't …
answered May 5 '11 by penguin359
6
votes
An alternate would be to just generate the map keybinding correctly for the OS. For example: if executable("cmd.exe") map ,v :!cmd.exe /C start "" "%<.pdf"<CR><CR> elseif $OSTYPE =~ "darwin.*" …
answered Apr 22 '11 by penguin359
15
votes
which includes GVim and GNOME Terminal, you can try Control-Shift-u followed by 4 hex characters to create a Unicode character. I'm sure KDE/Qt has something similar. UPDATE: As of Bash 4.2, it seems …
answered Apr 29 '11 by penguin359
3
votes
Try running it with bash foo.sh bar. If your going to write a bash script, you need to use bash. The [[ and ]] used above are only in bash which is a Bourne shell derivative. sh means Bourne SHell … and may not be the same as bash. I think debian uses dash for sh. If you instead want to learn how to write portable Bourne shell scripts that don't require bash specific features, you can rewrite …
answered Apr 28 '11 by penguin359
2
votes
One option is to run it with nohup: nohup mycoollittlescript Another would be to run it inside a terminal emulator like tmux or screen. These are terminal apps that are themselves terminal emulato …
answered Mar 3 '12 by penguin359
3
votes
When you say Function-F1, I assume you mean pressing that funny little Fn key in the corner of a laptop followed by the F1 key at the top left of the keyboard. And that your trying to map one of the …
answered Mar 3 '12 by penguin359
1
vote
.profile and .bash_profile are files that are sourced by bash when running as a login shell such as when logging in from the Linux Text console or using SSH. They are not sourced when loading a new …
answered Mar 2 '12 by penguin359