user2375256
user2375256

Reputation: 1

Using special "replace" characters in a bash script

I want to use the !!, !$,^abc^cde, etc. aliases in a bash script. Sadly, I cant seem to make them work in a script (They work just fine in interactive mode), Does anybody know what the problem is? If this can not be done, do you know about anything that operates in a similar way that can be used in a bash script?

Upvotes: 0

Views: 64

Answers (1)

Teddy
Teddy

Reputation: 6163

Use set +o histexpand to enable history expansion in non-interactive bash shells.

Upvotes: 1

Related Questions