Top "Shell" questions

The term 'shell' refers to a general class of text-based interactive command interpreters most often associated with the Unix & Linux operating systems.

PHP shell_exec() vs exec()

I'm struggling to understand the difference between shell_exec() and exec()... I've always used exec() to execute server side commands, …

php shell command exec
Replace a string in shell script using a variable

I am using the below code for replacing a string inside a shell script. echo $LINE | sed -e 's/12345678/"$replace"/…

unix shell sed
How to view files in binary from bash?

I would like to view the contents of a file in the current directory, but in binary from the command …

bash shell binary
Efficiently test if a port is open on Linux?

From a bash script how can I quickly find out whether a port 445 is open/listening on a server. I …

linux bash shell port
What does set -e mean in a bash script?

I'm studying the content of this preinst file that the script executes before that package is unpacked from its Debian …

linux bash shell sh
Capturing Groups From a Grep RegEx

I've got this little script in sh (Mac OSX 10.6) to look through an array of files. Google has stopped being …

bash shell grep
OS X Terminal Colors

I'm new to OS X, having just gotten a Mac after working with Ubuntu Linux for some time. Among the …

macos shell terminal colors
Exit Shell Script Based on Process Exit Code

I have a shell script that executes a number of commands. How do I make the shell script exit if …

bash shell
Get just the filename from a path in a Bash script

How would I get just the filename without the extension and no path? The following gives me no extension, but …

bash scripting shell
Get program execution time in the shell

I want to execute something in a linux shell under a few different conditions, and be able to output the …

linux bash shell