» Home » bash » Page 1
bash: Is there a shortcut to copying a file to multiple places without looping/bash script?
by Hugo in Network & Servers

I tried cp initial.txt {foo,bar,baz} but get baz is not a directory. And cp initial.txt foo bar baz doesn't work either.

Is there a way I can do this without making a shell script and looping and invoking cp multiple times? I'm thinking there has to be a succinct way of doing this.

how to print bash varibles contents into two dimensional array bash shell
by Jason Haar in Network & Servers

how do print bash shell variables contents into multidimensional array??


Bash: How to undo the effect of “set -e” which makes bash exit immediately if any command fails
by Al Velella in Network & Servers

After enter set -e in an interactive bash, bash will exit immediately if any command exits with non-zero. How can I undo this effect? Thanks.

Bash script with find command drops me to bash shell
by Nick Pegg in Network & Servers

I have the following bash script script.sh

find . -type f -iregex ".*java$" -print0
if [[ $rc != 0 ]] ; then
exit $rc

I was expecting that it will print all files ending with .java and then it will terminate. But this is not the happening. I does not print anything after I do ./script.sh but w

Git Bash: Launch Application via Alias without hanging Bash (WIndows)
by NesuD in Operating Systems

I've created several bash aliases in Git Bash on Windows, to launch executables from the bash shell.

The problem I am having is that is seems the bash is waiting for an exit code before it starts responding to input again, as once I close the app it launched, it starts taking commands again.

Is there a switch or something I can include in the alias so that bash doesn't w

C, Bash - processes that run bash scripts and work in parallel on the same file
by Blunc in Web Design

This is what I need:
I made a C program, it forks 2 childs: P1, P2
I also made some bash scripts.

I need P1 to run script1.sh, and P2 to run script2.sh.
At the moment I'm using the function system("script_name.sh") or system("script_name &") to make it asynchronous, I don't know if it's the right choice because for now they don't work as

Error -bash: ≈: command not found when starting a new bash after installing RVM
by Kevin in Programming Languages

I installed RVM, and updated my .bash_profile with:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

I get this error when opening a new terminal now:

-bash: ≈: command not found

what could be the reason?

Bash Templating: How to build configuration files from templates with Bash?
by codemnky in Network & Servers

I'm writting a script to automate creating configuration files for Apache and PHP for my own webserver. I don't want to use any GUIs like CPanel or ISPConfig.

I have some templates of Apache and PHP configuration files. Bash script needs to read templates, make variable substitution and output parsed templates into some folder. What is the best way to do that? I can think of several

Is it good style to call bash commands within a Python script using os.system(“bash code”)?
by zac in Development Tools & Services

I was wondering whether or not it is considered a good style to call bash commands within a Python script using os.system(). I was also wondering whether or not it is safe to do so as well.

I know how to implement some of the functionality I need in Bash and in Python, but it is much simpler and more intuitive to implement it in Bash. However, I feel like it is very hackish to write

Copy a file in bash that is actively written to in bash
by Jesse McDowell in Programming Languages

I need to be able to copy a text file to another location and then delete the contents of this text file (without deleting the file).

At the moment I am doing this:

for filename in `find . -name "*_list" -print`
while read -r line
echo $line
echo "### Tr

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .