Top "Bash4" questions

is a Unix shell written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell (sh).

How to write multiple line string using Bash with variables?

How can I write multi-lines in a file called myconfig.conf using BASH? #!/bin/bash kernel="2.6.39"; distro="xyz"; echo <&…

linux bash bash4
How to iterate over associative arrays in Bash

Based on an associative array in a Bash script, I need to iterate over it to get the key and …

bash associative-array key-value bash4
How to run BASH script in my Android?

My same BASH script is working in Fedora/CentOS. But I am testing one Android eee pad transformer. Where i …

android linux bash fedora bash4
How can i log error from my script.sh every time I run the script.sh and save output to a file?

How can I save the error output when running my script to a file? I have my code bellow, but …

bash bash4
In BASH, How do i replace \r from a variable that exist in a file written using HTML <textarea></textarea>

How do i replace the \r? #!/bin/bash ... # setup if [[ $i =~ $screen ]]; then ORIGINAL=${BASH_REMATCH[1]} # original value is: 3DROTATE\…

linux bash fedora archlinux bash4
What method should I use to write error messages to 'stderr' using 'printf' in a bash script?

I want to direct the output of a printf in a bash script to stderr instead of stdout. I am …

bash stderr io-redirection bash4
Multiple matches in a string using regex in bash

Been looking for some more advanced regex info on regex with bash and have not found much information on it. …

bash bash4
Simple Bash and RegEx Questions

I'm unable to get a pattern to match properly using regex in bash 4.1. I've read some information on about differences …

regex bash bash4
place a multi-line output inside a variable

I'm writing a script in bash and I want it to execute a command and to handle each line separately. …

bash bash4
Bash RegEx to check floating point numbers from user input

I'm relatively new to bash programming and i am currently creating a simple calculator. It needs to use floating point …

regex bash expression bash4