Linked Questions

2 votes
1 answer
1k views

You can write a bash functions several ways: function JoinStrings { ...; } Or function JoinStrings () { ...; } Or JoinStrings () { ...; } Is there any difference between these functions?...
bodacydo's user avatar
  • 322
1 vote
0 answers
164 views

There is two ways to define function in bash script. 1. function FuncName() { echo "$FUNCNAME" } 2. FuncName() { echo "$FUNCNAME" } So my questions is what's the different between in this ...
Rahul Patil's user avatar
  • 25.6k
181 votes
11 answers
421k views

I would like to get the multi pattern match with implicit AND between patterns, i.e. equivalent to running several greps in a sequence: grep pattern1 | grep pattern2 | ... So how to convert it to ...
greenoldman's user avatar
  • 6,526
27 votes
8 answers
17k views

I am programming a Linux shell script that will print status banners during its execution only if the proper tool, say figlet, is installed (this is: reachable on system path). Example: #!/usr/bin/...
Sopalajo de Arrierez's user avatar
5 votes
2 answers
17k views

I have checked the previous post on this error. still did not get the solution working. Here is my bash script. can some one help me figure out the issue . I have used https://www.shellcheck.net/ to ...
Bobby's user avatar
  • 77
3 votes
3 answers
14k views

How can I use the integer value returned by a function in shell script that takes some arguments as input? I am using the following code: fun() { echo "hello ${1}" return 1 } a= fun 2 echo $...
g4ur4v's user avatar
  • 1,884
-1 votes
1 answer
2k views

I have a bash function declared like so: function foo { echo "this is foo"; } I didn't call export -f foo, but it still was available in subshells. However, typically when I declare a function ...
Alexander Mills's user avatar
1 vote
2 answers
1k views

For some reason, my finger memory has converted mv to rm. Until I manage to retrain those fingers, how might I have rm prompt when provided multiple locations (one of which likely does not exist)? I ...
dotancohen's user avatar
  • 16.5k
0 votes
1 answer
195 views

I am freshening up my bash skills. I use the term skills very loosely; I've been outta the game a long time. So, as a way to brush up, I decided to code something utilizing bash/zenity/yad. I read man ...
endorpheus's user avatar
-1 votes
1 answer
139 views

I have recently Updated from 14.04.3 LTS to 16.04.2 LTS. My shell scipts that got executed on 14 version are failing in the latest version i.e. 16.04.2. Below are the sample errors: test: 24: test: ...
sneha's user avatar
  • 7