![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need to dynamically create a file | stareja | Shell Programming and Scripting | 14 | 05-07-2009 08:15 AM |
| Spliting the file dynamically | kingganesh04 | Shell Programming and Scripting | 4 | 12-16-2008 06:46 AM |
| Dynamically ftp'ing a file | pyaranoid | UNIX for Advanced & Expert Users | 0 | 09-02-2007 08:34 AM |
| locating the last file in the directory | wip_vasikaran | UNIX for Dummies Questions & Answers | 2 | 03-27-2007 09:13 AM |
| dynamically linked file | sveera | Shell Programming and Scripting | 1 | 05-06-2005 03:40 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Dynamically locating a file
Hi,
I have a requriement where in I need to install a s/w by executing the installable file through a script. The script currently contains the path of the installable file. I need to now update the script accordingly such tht it identifies the location of the installable file automatically and executes it.... I need to make the script path independent... Can anyone pls help with regard to this..... Thanks.... |
|
||||
|
If the installable file can be identified accurately by name only - you really should have a checksum for it as well. Code:
#!/bin/ksh # i made up the checksum value :) i'm using md5 - you can use cksum or whatever mychecksum="2d786401096622f33b2cbed35c1bee39" file_to_execute=$(find / -type f -user root -name install_file) thischecksum=$(md5 $file_to_execute) if [[ "$thischecksum" = "$mychecksum" ]] ; then $file_to_execute parm1 parm2 else echo "no valid file found" fi |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|