![]() |
|
|
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 |
| iTunes: About the Add to Library, Import, and Convert functions | iBot | OS X Support RSS | 0 | 04-26-2009 03:30 AM |
| Creating functions in shell script | gjithin | Shell Programming and Scripting | 1 | 05-10-2008 04:15 AM |
| Calling shell functions from another shell script | jisha | Shell Programming and Scripting | 6 | 04-05-2008 05:29 PM |
| functions in c shell?? | ballazrus | Shell Programming and Scripting | 1 | 02-16-2006 05:14 AM |
| Shell script functions | r_subrahmanian | Shell Programming and Scripting | 5 | 12-13-2005 02:05 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
using library functions in shell script
hey guys, i made up a library file called common.lib so as to reuse the same code without typing it again. here is the code. its pretty basic . Code:
## This is the second function
compare()
{
file1 = $1
file2 = $2
cmp $file1 $file2
if [ $file1 -eq $file2 ]
then
echo "comparison is possible"
else
echo "compariosn is not possible"
fi
}
i have another shell script that uses the function 'compare' from the library file . here is the code. Code:
#!/usr/bin/bash . ./common.lib compare $file1 $file2 i know i am going wrong somewhere because when i try to execute the shell script, the cursor just waits at the console without spitting out any output. after a while i have to terminate the process using ctrl+c . please tell me where i am going wrong. thanks Arsenalboy. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|