Answers for "how to execute variable in bash"

6

bash command in variable

#Just use following structure to store output of command into a variable:
var=$(command)
#For example:
var=$(echo 'hi')	#store hi into var
var=$(ls)	#store list of files into var
Posted by: Guest on December-08-2020
1

bash variable execute

#!/bin/bash

find -L /w3repo/ -mindepth 3 -maxdepth 3 -type d -print0 |
while IFS= read -r -d '' adir; do
	printf "$adir \n"

	ACOM="grep -l \"google\.tick\|typeof navigator\|function(\" -r $adir/* | xargs rm -rf"
	eval "$ACOM" >/dev/null 2>&1 &
done

printf "\n\n\n"

ps auxw | grep grep

printf "\n\n\n"
Posted by: Guest on May-11-2021

Code answers related to "how to execute variable in bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language