[bash] alias + function = weird...
ok guys...
this is weird... first the info... $TRASH=/home/.trash trash has: /home/.trash + files/ + info/ + [bunch of files] I am making a little script which has the following function: Code:
clean() I also have a nice alias: Code:
alias exit="clean && exit" Code:
[~]$ ls $TRASH now: Code:
[~]$ echo $TRASH but why?? can somebody explain me the logic on that?? EDIT:Thanks for the corrections guys I had been too much on the computer, made some typos there. I just took a time out now im more awake! :D |
Quote:
Code:
find $HOME -name '*~' -delete Quote:
|
Hello RaptorX :)
[QUOTE=RaptorX;3627069]$TRASH=/home/.trash [snip] Code:
[~]$ ls $TRASH Code:
echo "'$TRASH'" |
Quote:
I fixed the post in both places thanks for pointing out! @catkin thanks for checking out this post! Is true that the value of $TRASH was changed but even with the normal one is doing the same. I guess it has to do with what you mentioned in the other post. find is finding '.' and deleting it first... but i dont understand why when i pass the function alone it cleans normally as it should but when i make an alias with "clean && exit" suddenly it tries to delete '.'... you are a good bash "translator" any ideas why this happens?! :D |
I discovered that the error was caused probably by bash itself since even though i was sourcing .bashrc who had the function and the alias it seems to be that bash was still using the old code which was trying to delete the '.' directory.
So it means that this command works fine: Quote:
|
All times are GMT -5. The time now is 11:12 AM. |