System Software Lab Programs ( UNIX Programs ) – 4a

// June 3rd, 2009 // Educational, Engineering, Unix and System Software Lab

Subject : System Software Laboratory

Branch : Information Science & Engineering

Semester : 6

University : VTU

[Click Here to get other programs by email ]

………………………………………………………………………………………………………………………….
PART -B

………………………………………………………………………………………………………………………….

4. a) Shell script that accepts file names specified as arguments and creates a shell script that contains this file as well as the code to
recreate these files. Thus if the script generated by your script is executed, it would recreate the original files(This is same as the “bundle” script described by Brain W. Kernighan and Rob Pike in “ The Unix Programming Environment”, Prentice – Hall India).

#!/bin/bash

echo “# to unbundle,bash this file n:”
for i
do
echo “echo $ i1>i2″
echo “cat >$i <<’END of $i’”
cat $i
echo “END OF $i”
echo -e
done

[Click Here to get other programs by email ]