# Will files, creaetd in one function of the same script will be recognized in another function?

**URL:** <https://community.unix.com/t/will-files-creaetd-in-one-function-of-the-same-script-will-be-recognized-in-another-function/365348>\
**Category:** Shell Programming and Scripting\
**Created:** [March 2, 2017, 10:21am UTC](https://community.unix.com/t/will-files-creaetd-in-one-function-of-the-same-script-will-be-recognized-in-another-function/365348 "2017-03-02T10:21:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![digioleg54](https://community.unix.com/letter_avatar/digioleg54/32/6_449c533f586939b6e5f246632a46421f.png) [@digioleg54](https://community.unix.com/u/digioleg54)\
**Post date:** [March 2, 2017, 10:21am UTC](https://community.unix.com/t/will-files-creaetd-in-one-function-of-the-same-script-will-be-recognized-in-another-function/365348/1 "2017-03-02T10:21:11Z")

</div>

Dear All.

I have a script, which process files one by one. In the script I have two functions.  
one sftp files to different server  
the other from existing file create file with different name.  
My question is:  
Will sftp function recognize files names , which are created in another function, or I have to provide file name as argument?

---

<div class="post-metadata">

**Author:** ![jim\_mcnamara](https://community.unix.com/letter_avatar/jim_mcnamara/32/6_449c533f586939b6e5f246632a46421f.png) [@jim\_mcnamara](https://community.unix.com/u/jim_mcnamara)\
**Post date:** [March 2, 2017, 10:30am UTC](https://community.unix.com/t/will-files-creaetd-in-one-function-of-the-same-script-will-be-recognized-in-another-function/365348/2 "2017-03-02T10:30:21Z")

</div>

Pass the file name as an argument.
