# scripting

**URL:** <https://community.unix.com/t/scripting/210307>\
**Category:** Shell Programming and Scripting\
**Created:** [August 28, 2008, 4:35am UTC](https://community.unix.com/t/scripting/210307 "2008-08-28T04:35:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anurag.mishra1](https://community.unix.com/letter_avatar/anurag.mishra1/32/5_5575768a8748004e209b776fc1b2916d.png) [@anurag.mishra1](https://community.unix.com/u/anurag.mishra1)\
**Post date:** [August 28, 2008, 4:35am UTC](https://community.unix.com/t/scripting/210307/1 "2008-08-28T04:35:28Z")

</div>

i want to send a file that I have saved using a vi editor to another shell script. I also want that script (2nd one) to display the contend of the file.

Please help me by giving the code.

---

<div class="post-metadata">

**Author:** ![vidyadhar85](https://community.unix.com/user_avatar/community.unix.com/vidyadhar85/32/997_2.png) [@vidyadhar85](https://community.unix.com/u/vidyadhar85)\
**Post date:** [August 28, 2008, 4:39am UTC](https://community.unix.com/t/scripting/210307/2 "2008-08-28T04:39:56Z")

</div>

send that file as an argument to second script  
and if you want to display only the content you can use cat command in that second script  
secscript filename  
cat $1---\>this is what you have to write in secscript

---

<div class="post-metadata">

**Author:** ![anurag.mishra1](https://community.unix.com/letter_avatar/anurag.mishra1/32/5_5575768a8748004e209b776fc1b2916d.png) [@anurag.mishra1](https://community.unix.com/u/anurag.mishra1)\
**Post date:** [August 28, 2008, 4:43am UTC](https://community.unix.com/t/scripting/210307/3 "2008-08-28T04:43:01Z")

</div>

could you please clarify with a code . I am just learning scripting by experimenting . pl

---

<div class="post-metadata">

**Author:** ![palsevlohit\_123](https://community.unix.com/user_avatar/community.unix.com/palsevlohit_123/32/1053_2.png) [@palsevlohit\_123](https://community.unix.com/u/palsevlohit_123)\
**Post date:** [August 28, 2008, 4:43am UTC](https://community.unix.com/t/scripting/210307/4 "2008-08-28T04:43:55Z")

</div>

$ cat shell1.ksh  
sh shell2.ksh /unix/passme.txt

$cat shell2.ksh  
echo $1  
cat $1

Hi,  
you can pass the filename with path to the second shell as a Parameter.  
in the second you will get that as $1 and you can use that.

in the above example "/unix/passme.txt" is the filename which i passing to shell2.ksh from shell1.ksh. shell2.ksh will get that as $1 and use it.

---

<div class="post-metadata">

**Author:** ![vidyadhar85](https://community.unix.com/user_avatar/community.unix.com/vidyadhar85/32/997_2.png) [@vidyadhar85](https://community.unix.com/u/vidyadhar85)\
**Post date:** [August 28, 2008, 4:45am UTC](https://community.unix.com/t/scripting/210307/5 "2008-08-28T04:45:34Z")

</div>

> [@anurag.mishra1](#):
>
> could you please clarify with a code . I am just learning scripting by experimenting . pl

let file1 be your filename what you saved in vi editor  
open a new file namely file2.sh  
in that just write  
cat $1

then run that as  
file2.sh file1

then it will display the content of file1

---

<div class="post-metadata">

**Author:** ![anurag.mishra1](https://community.unix.com/letter_avatar/anurag.mishra1/32/5_5575768a8748004e209b776fc1b2916d.png) [@anurag.mishra1](https://community.unix.com/u/anurag.mishra1)\
**Post date:** [August 28, 2008, 4:47am UTC](https://community.unix.com/t/scripting/210307/6 "2008-08-28T04:47:19Z")

</div>

but my problem is that the name of the file will be dynamic. i have a shell script (1st) that displays a splash screen , then the user can chose a vi editor and save the file and quits the editor. At that time I want the contend of the file to be send to the next shell script .

pl help

---

<div class="post-metadata">

**Author:** ![vidyadhar85](https://community.unix.com/user_avatar/community.unix.com/vidyadhar85/32/997_2.png) [@vidyadhar85](https://community.unix.com/u/vidyadhar85)\
**Post date:** [August 28, 2008, 5:06am UTC](https://community.unix.com/t/scripting/210307/7 "2008-08-28T05:06:35Z")

</div>

> [@anurag.mishra1](#):
>
> but my problem is that the name of the file will be dynamic. i have a shell script (1st) that displays a splash screen , then the user can chose a vi editor and save the file and quits the editor. At that time I want the contend of the file to be send to the next shell script .
> 
> pl help

can you post your first script..

---

<div class="post-metadata">

**Author:** ![anurag.mishra1](https://community.unix.com/letter_avatar/anurag.mishra1/32/5_5575768a8748004e209b776fc1b2916d.png) [@anurag.mishra1](https://community.unix.com/u/anurag.mishra1)\
**Post date:** [August 28, 2008, 5:09am UTC](https://community.unix.com/t/scripting/210307/8 "2008-08-28T05:09:49Z")

</div>

it just displays a splash screen using the dialog utility. I don't how to do the remaining. pl help
