Where can i find .bash_profile?Put the program you want to execute in your .bash_profile. When you login, the .bash_profile gets executed and it will execute whatever you have it in.
Sry but in my /home/ directory only find .bash_history, .bash_logout and bashrc, /home/ is the correct directory?In your home directly. Because it starts with a ".". You need to do a 'ls -a' to physically see it. -a = all.
Ok i already create the .bash_profile, but whe i try do for example:If it doesn't exist, you can just create it.
touch ~/.bash_profile
or just use an editor to create it and add what you need to it.
vim ~/.bash_profile
Just ensure the filename itself starts with a "."
The correct directory is the user's home direct. If the username is bob. It's /home/bob/.bash_profile
So i don´t know but it didn't worked so i did a research and i used ~/crontab -e and it works. Thank you so much to trying to help me!Your .bash_profile is not a "script" in the normal sense you would create bash scripts.
With that said.
- You don't need the shabang at the top. (ie, the "#!/bin/bash" ) Remove it.
- Your shabang is incorrect anyhow. You're missing the exclamation point. #!/bin/bash
- You do not exit from a .bash_profile. (remove the "exit 0")
- The .bash_profile should not be executable. ("chmod -x ~/.bash_profile")
- To test execute the .bash_profile (without logging in / out) you would execute it by doing (without quotes) ". ~/.bash_profile" Notice the "." then a space " ", then the filename. "~/.bash_profile"