Top "Bash" questions

For questions about scripts written for the Bash command shell.

How to set current working directory to the directory of the script in bash?

I'm writing a bash script. I need the current working directory to always be the directory that the script is …

bash path scripting
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
Return value in a Bash function

I am working with a bash script and I want to execute a function to print a return value: function …

bash function return-value
What is the purpose of "&&" in a shell command?

As far as I know, using & after the command is for running it in the background. Example of & …

bash shell command-line syntax
"unary operator expected" error in Bash if condition

I've been trying to figure out whats wrong with this but just can't figure it out.. This is the part …

bash shell
Bash: If/Else statement in one line

I am trying to check if a process (assume it is called some_process) is running on a server. If …

bash
How to enter ssh password using bash?

Everyday I am connecting to a server through ssh. I go through this routine: IC001:Desktop user$ ssh user@my.…

bash ssh
Run a string as a command within a Bash script

I have a Bash script that builds a string to run as a command Script: #! /bin/bash matchdir="/home/joao/…

bash shell command-line-arguments
How to split one string into multiple strings separated by at least one space in bash shell?

I have a string containing many words with at least one space between each two. How can I split the …

bash shell string split
How can I escape a double quote inside double quotes?

How can I escape double quotes inside a double string in Bash? For example, in my shell script #!/bin/bash …

bash quotes