![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Solaris - unknown hostname - how can I change hostname? | XNOR | UNIX for Dummies Questions & Answers | 1 | 03-29-2007 07:52 PM |
| /etc/hostname.interface file | ghuber | SUN Solaris | 1 | 01-26-2006 07:29 AM |
| Splitting a file based on some condition and naming them | srivsn | Shell Programming and Scripting | 1 | 12-07-2005 07:27 AM |
| Controller Naming | shibz | UNIX for Advanced & Expert Users | 1 | 01-22-2003 07:07 AM |
| Perl - naming a file after the date/time | tgreig | Shell Programming and Scripting | 1 | 05-22-2002 04:14 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
naming a file to hostname
I am running a script remotely to another client. after it runs it places the file in /tmp. I need the file in /tmp to be renamed to the local hostname. but when i set the variable it names the file to my local hostname. how do i fix that
|
| Forum Sponsor | ||
|
|
|
|||
|
ok i will provide everything in detail.
the file i have is called sys_diag that i downloaded from SUN that someone wrote. I that file on my machine in /var/tmp when you run this script it will generate a .html file so this is my script #!/bin/sh list='01 02 03 04 05" for x in $list ; do echo $x rcp test:/var/tmp/sys_diag test${x}:/tmp rsh test${x} /tmp/sys_diag -o -u (-o and -u are switches for location) once it runs it prompts for a location to store the file so i enter /tmp (right here i need the rename of the .html file that is in tmp) rsh test${x} mv /tmp/sysd_*/*.html 10.200.xxx.xxx:/tmp rsh test${x} rm -r /tmp/sysd_* /opt/firefox/firefox /tmp/*.html basically i copy the script from my box to the remote box run it on the remote system. Then i just bring over the *.html file to my local machine and launch it in a browser. I know it all looks complicated but the above is the only scripting i really know for now. what i will do is create and database of all system information and update it once a month for other sites to view if they have questions about the system since they usually do. this will all be in .html web based Solaris 9 |