Results 1 to 5 of 5
how to check if a string is already used as an alias in bash?...
- 05-25-2009 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 41
[SOLVED] how to check if a string is already used as an alias?
how to check if a string is already used as an alias in bash?
- 05-25-2009 #2
try this
# alias | grep yourstring
- 05-25-2009 #3Just Joined!
- Join Date
- Jul 2007
- Posts
- 41
- 05-27-2009 #4Linux User
- Join Date
- May 2008
- Location
- NYC, moved from KS & MO
- Posts
- 251
This should be what you are looking for
You can also re-write the above if block in this format:Code:if `alias|grep -q str`; then unalias str; fi
Code:[ -n "`alias|grep str`" ] && unalias str
- 05-27-2009 #5



