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.
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.
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
could you please clarify with a code . I am just learning scripting by experimenting . pl
$ 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.
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
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..
it just displays a splash screen using the dialog utility. I don't how to do the remaining. pl help