
How do I unset or get rid of a bash function? - Super User
147 If you set or export an environment variable in bash, you can unset it. If you set an alias in bash, you can unalias it. But there doesn't seem to be an unfunction. Consider this (trivial) …
How to call bash functions - Super User
[~/Desktop/bashPlay]% cat myFunc #!/bin/bash ls2(){ echo "Hello World" } ls3(){ echo "Testing" } echo "this is a test" ls2 # this calls a function [~/Desktop/bashPlay]% myFunc this is a test …
How to set a global variable from a bash function when its output …
Oct 29, 2024 · A shell function can affect the execution environment of the shell; and a shell function can be used in a pipeline. The problem is the two functionalities cannot work at the …
Print echo and return value in bash function - Super User
May 8, 2018 · bash function returns value with echo and log with echo, and fun1 with several input parameters ?
bash - What does 'source' do? - Super User
Sep 24, 2009 · One common use for this command is for a shell script to source in a "configuration file" that contains mostly variable assignments. The variable assignments then …
shell - Finding the definition of a bash function - Super User
Assuming you have a function named foo the commands below will get the location of the function's definition, that is it will get the name of the file in which the function is defined as well …
bash - Where are shell functions stored on Linux? - Super User
Dec 30, 2014 · User define start-up scripts: ~/.bash_profile for login shells, and ~/.bashrc for interactive shells. More information on interactive/login shells can be found in the bash man …
syntax error near unexpected token `(' writing bash function
I'm slightly embarrassed to admit I had several moments of panic about having to modify years' worth of Bash scripts because the function syntax had changed in Bash 5.x.something.
bash - return array from function and display contents
Nov 17, 2015 · This solution does not pass an array from a function, but it does allow you to convert the output of a function to an array. Some are satisfied with converting a list to a string …
Continuously re-execute a command when it finishes in Bash
7 You can plan ahead during command execution (provided it isn't interactive) and enter !! which will execute the previous command again. This works e.g. during ping -c 5. You can also …