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 4194

The shell is Unix's command-line interface. You can type commands in a shell interactively, or write scripts to automate tasks. Use this tag for questions applying to /bin/sh and most compatible shells (ash, bash, ksh, zsh, …). For shell scripts with errors, please check them in http://shellcheck.net before posting here.

1
vote
On systems where you don't have sudo access or proper permission to use chsh (for example if you cannot add /bin/zsh to /etc/shell), then you can do it the old fashioned way: $ mv ~/.bash_profile … ~/.bash_profile.old $ (echo :; echo exec /bin/zsh -il) > ~/.bash_profile $ source ~/.bash_profile This will replace the bash shell with a login zsh at login. …
answered Oct 16 '11 by Arcege
12
votes
Originally, it was used to determine that it was a Bourne shell program, as opposed to C compiled program. This was before shebang and multiple scripting languages (csh, perl). You can still run a … script starting with just :: $ echo : > /tmp/xyzzy $ chmod +x /tmp/xyzzy $ ./xyzzy It will generally run the script against $SHELL (or /bin/sh). Since then, the main use is to evaluate the arguments. I still use: : ${EDITOR:=vim} to set a default value in a script. …
answered Apr 27 '12 by Arcege
14
votes
As saeedn mentions, aliases are a good mechanism. The bash shell also has a built-in mechanism to jump right to a location: CDPATH. Set it like PATH, but it is used by cd instead of searching for … list of directories in which the shell looks for destination directories specified by the cd command. A sample value is ".:~:/usr". Myself, I've combined this …
answered Dec 14 '11 by Arcege
12
votes
?" ":"\n"' $file > "$(basename "$file" .tex)_sorted.tex"; done Since you don't specify which shell, go with the more standard basename instead using the shell specific syntax ${file%%.tex}. …
answered Feb 19 '12 by Arcege
5
votes
You seem to want the count instead of the 'Start' output. Display count instead: tcpdump -i any -s 65535 host 192.168.1.110 and port 1645 or port 1813 -v -X | awk '/Start/ {c++;print c} {}' Disp …
answered Dec 31 '11 by Arcege
1
vote
The PATH variable is reserved for finding programs that the shell will use. It is a list of directories, separated by colons (:) which is searched in order until the program is found. From the … manpage of bash PATH The search path for commands. It is a colon-separated list of directories in which the shell looks for commands (see COMMAND EXECUTION below). A zero-length (null) directory …
answered Mar 4 '12 by Arcege
8
votes
Each application will have its own set of 'special' characters. The issue that you ran into was with grep not the shell. For which characters need to be quoted in grep, read the manpage's section … on "REGULAR EXPRESSIONS". For the shell, that characters that should be quoted are: ;'"`#$&*?[]<>{}\ and any whitespace. Depending on the shell, other characters may need to be quoted as well: !^% Look under "SHELL GRAMMAR" on the shell's manpage. …
answered Sep 15 '11 by Arcege
14
votes
The /bin/sh (dash) shell is a POSIX compliant, reduced functionality shell to be more efficient (smaller) for booting the system. As part of that, history and advanced command-line editing are not … included. It is more appropriate for strict POSIX scripting than as an interactive shell. The idea is that the 'login' shell would be bash by default, but the boot system would be using dash. The …
answered Sep 30 '11 by Arcege
4
votes
Part of the problem is that the string returned by args.sh is not parsed the same as a direct command, but only by the value of $IFS ($' \t\n'). Try turning on command tracing with set -x: $ sh /tmp …
answered Mar 21 '12 by Arcege
-1
votes
First, the -R option is for recursion, which is probably not what you want - that will search in all subdirectories as well. Second, the < operator (when not being seen as redirection) is for string …
answered Apr 5 '12 by Arcege
4
votes
Sounds like there is no file matching sftp_bcs_report_*.log in the starting directory on the second machine and more than one such file on the first server. For using find, patterns should always be …
answered Mar 28 '12 by Arcege
-1
votes
Using find is probably the best bet. Some of the problems with the other answers are either not deleting everything inside the directory or deleting the directory itself. You can either use ls with …
answered Apr 6 '12 by Arcege
3
votes
, called sshwrapper, which you call with an optional command or no arguments to get an interactive shell. : sshwrapper [command] exec /usr/bin/ssh "${HOSTNAME:-localhost}" "$@" This would attempt … to run "" on the remote host (which just returns), it would not be an interactive shell. : sshwrapper [command] exec /usr/bin/ssh "${HOSTNAME:-localhost}" ${1:+"$@"} Would start an interactive shell
answered Mar 19 '13 by Arcege
3
votes
The first : is a command, it's called a "noop" or "no operation". As said in the manpage, it is often used to evaluate the arguments. The second : is a qualifier in the variable expansion - technica …
answered Nov 26 '11 by Arcege
58
votes
Some versions of sort have a -z option, which allows for null-terminated records. find folder1 folder2 -name "*.txt" -print0 | sort -z | xargs -r0 myCommand Additionally, you could also write a hig …
answered Mar 16 '12 by Arcege

15 30 50 per page