'uptime' bash script
I'm looking to put my system uptime into my bash prompt. I checked out the Bash-Prompt-HOWTO and it showed a script the author had written. I tried to make this into a script that I could use, but bash is returning errors. I don;t know the first thing about bash programming, so could someone help find the error? Thanks!
icy Code:
#!/bin/bash |
you have to post the error message before anyone can help you.
anyways the first line looks funny, try.... upSeconds=`cat /proc/uptime`; upSeconds=${upSeconds%%.*}; |
If you get a "command not found" type error, most likely its just not executable. chmod +x filename
|
Thanks so much, that really helps. I like the uptime in my prompt.
|
I was just reading the bash-prompt how-to as well, very cool. I changed my prompt to this:
[03:50][bulliver@badcomputer bulliver]$ I have different colors for each user which helps to keep track of all the different shell sessions. Here's the PS1: \[\033[0;35m\][$(date +%H:%M)][\u@\h \W]$\[\033[0m\] |
All times are GMT -5. The time now is 12:57 AM. |