Tiny Core Linux
General TC => General TC Talk => Topic started by: remus on September 24, 2014, 09:51:09 PM
-
Hi all,
I'm writing a bash script to do a backup, and am wondering how I use the hostname in a bash script in tinycore.
If I type hostname enter from the prompt, I get the following.
$ hostname
backserver
However I have had no luck using it in my script. I just want to echo the hostname of the server running the script into a log file, that has some other stuff in it.
Any suggestions and comments welcome.
Thanks.
-
Hi remus
This will append the hostname to the end of filename.log:
hostname >> filename.log