Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parenthesis inside bash function

Status
Not open for further replies.

JRyanCon

Technical User
Aug 19, 2004
47
US
Is there a way to include a command that contains parenthesis inside a bash function? I get an error for an unexpected ( found when I try. I am trying to include the following inside of a bash function:

cleanup () {
shopt -s extglob
rm !(FileToKeep)
}


 
Hi

Move the [tt]shopt[/tt] out from the function. ( Sorry, cannot explain why. )


Feherke.
feherke.ga
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top