The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
naming a file to hostname
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
naming a file to hostname
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
3
(
permalink
)
11-19-2007
sysgate
Unix based
Join Date: Nov 2006
Location: Bulgaria
Posts: 1,323
While the script is running on the remote system, get the local hostname with "hostname", set variable like :
hostname_to_append = `hostname`
cp /tmp/file /tmp/file-$hostname_to_append
or replace cp with mv.
But you didn't specify OS and the script's language.
sysgate
View Public Profile
Find all posts by sysgate
Find sysgate's past nominations received
Find sysgate's present nominations given