You are not logged in.
After you added the code to .bashrc, you need to start a new terminal (so .bashrc gets reloaded) or run this:
source ~/.bashrc(not very complete in my answers, this morning, am I? sorry, I'm still on my first cup of tea)
Last edited by 2ManyDogs (2012-03-15 13:37:37)
Be eggsalad to each other.
Offline
your ~/.bashrc is loaded on starting a terminal. when you add something to your .bashrc and your terminal is still open, it isn't getting reloaded. after editing your .bashrc, always do this:
. ~/.bashrcor (exactly the same but longer)
source ~/.bashrcOffline
damnit 2manydogs! beat me to it again!
Offline
^ 
OK confirmed ~/scripts is in my path, still says command not found when i try executing
@scriptdoes the actual script have to be added to the .bashrc as in your post or just the scripts folder in which it is contained?
#! Waldorf - 64bit - Xfce
Offline
You should not need to add the name of the script to .bashrc. Something else is broken here.
Rhowaldt, can you help? I need to work on the scrotwm review. 
Be eggsalad to each other.
Offline
^ Yes. I'm waiting for that review to! 
#! Waldorf - 64bit - Xfce
Offline
2ManyDogs wrote:
Sorry, I should have explained that. If you don't know, it probably isn't, but to check do this:
echo $PATH
Then if it's not there, open ~/.bashrc, and add this at the end:
#add @scripts and bin folders to path
PATH=$PATH:~/scripts/@scripts:~/bin
export PATHIf that doesn't work we can try something else.
Fixed it, I removed the '@scripts' from the .bashrc and it now works. 
Thanks!
#! Waldorf - 64bit - Xfce
Offline
Sorry, I thought @scripts was the name of the folder. Glad you got it sorted (and now you know a lot more about paths and scripts!) 
Be eggsalad to each other.
Offline
@2manyWMs: feel free to go to your Master Task when you need to. i'll help out on my own script, i posted it myself after all 
@kri5: good to see you fixed it. as 2many said, you're learning fast by messing stuff up 
in case you want to know more about all of this stuff, check out the link titled 'bash' in my signature. but even if you do, a definitive first read would be here: http://tldp.org/LDP/Bash-Beginners-Guide/html/
that link explains from scripts to the $PATH environment variable and all sorts of other stuff you need to know when working with Bash.
good luck!
Offline
^ Thanks for the links and advice, i have bookmarked them for reading later. 
#! Waldorf - 64bit - Xfce
Offline
Just wanted to say that this script has been invaluable to me. I absolutely love it. Here is the modified version i use on my system:
#!/bin/bash
#== Creates or opens a script in ~/bin
_LOCATION="$HOME/bin"
_PATH=""
if [ $# -lt 1 ]; then
echo "Use '@script <scriptname> [<location>]'."
exit
fi
if [ $2 ]; then
if [ ! -d "$2" ]; then
echo "Location does not exist."
exit
else
_LOCATION="$2"
fi
fi
_PATH="$_LOCATION/$1"
if [ -f $_PATH ]; then
nano $_PATH
else
touch $_PATH
chmod +x $_PATH
nano $_PATH
fiThe only difference is that it checks to see if the file exits, and only opens it otherwise, it doesn't bother marking it executable (as it already should be). I used to have a separate script called @edit which edited existing scripts for me, but then i merged them into one.
Last edited by Komrade_Toast (2012-05-14 05:27:26)
Offline
^ thanks Komrade Toast! appreciate it. the merge seems logical, good thinking. glad you are as happy with the script as i am.
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.