![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing more than one argument in a function | jisha | Shell Programming and Scripting | 1 | 04-23-2008 07:05 AM |
| How to pass variables to FUNCTION ? | bh_hensem | Shell Programming and Scripting | 5 | 05-31-2007 03:54 AM |
| How do I pass a wild card as an argument | eja | UNIX for Dummies Questions & Answers | 2 | 03-28-2007 03:03 PM |
| Passing Argument to Function | AkumaTay | UNIX for Dummies Questions & Answers | 2 | 10-18-2001 07:24 PM |
| pass argument to a filename | jpprial | UNIX for Dummies Questions & Answers | 1 | 09-03-2001 04:12 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Pass argument to function
Hi,
Can someone please explain to me how I can get a function to recognize a file given as an argument to a script. Suppose the script has the argument as follows: sh script file and the function is as follows: function display_file () { cat $1 } and it s then called #main program display_file I find that the only way that I can get the file into the function is to make a copy in the main program like so: cp $1 temp I have read some lit on functions but haven't come accross this type of problem as far. Thanks in advance, Knotty. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|