Sponsored Content
Top Forums Shell Programming and Scripting To Create shell script files from a shell script Post 302440475 by NehaB on Tuesday 27th of July 2010 10:03:12 AM
Old 07-27-2010
To Create shell script files from a shell script

Dear Unix and Linux users,
Good evening to all.
I'm new to this community and thank you for having an wonderful forum.

Dear members i had to create almost some 300 shell script files for a particular task.
I tried something like this....

Code:
#!usr/bin/sh
fname=epdb_jobs
for x in `cat $fname`
do
if [ ! -s $x.epdb.com ]
then
echo Creating file...
cat > $x.epdb.com <<EOF
echo fname1=num_$x.txt
for y in `cat $fname1`
do
head -$y t_$x.mol2 | tail -n 200 | head -48 >>rlig_$x.mol2
done
stop
EOF
fi
echo "done $x"
done


By using this script i read the part of the filename from epdb_jobs file and then
i want a new file to be created such that
1RAA.epdb.com
this file should be like the one shown below

Code:
fname1=num_$x.txt
for y in `cat $fname1`
do
head -$y t_$x.mol2 | tail -n 200 | head -48 >>rlig_$x.mol2
done

I have to create 300 different files like this I don't know where i'm going wrong.
please help me.Thanks in advance.
Neha.

Last edited by Scott; 07-27-2010 at 11:18 AM.. Reason: Code tags, please...
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How To create Flat Files using Unix Shell Script?

Hi all, How to create Flat Files using Unix Shell Script. The Script is supposed to be sheduled to run at a particular time? Thanks in advance Appu (4 Replies)
Discussion started by: Aparna_k82
4 Replies

2. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies

3. Shell Programming and Scripting

Shell Script Create List of Deleted Files

Hi, I want to put all the deleted files in a txt file. Because i want to backup my image server which has thousands of jpg images. I wrote a shell script which will copies images from image server to backup image server. I setup a cronjob which runs on every five minutes. & through timestamp it... (8 Replies)
Discussion started by: mirfan
8 Replies

4. Shell Programming and Scripting

To write a shell script which groups files with certain pattern, create a tar and zip

Hi Guru's, I have to write a shell script which groups file names based upon the certain matching string pattern, then creates the Tar file for that particular group of files and then zips the Tar file created for the respective group of files. For example, In the given directory these files... (3 Replies)
Discussion started by: rahu_sg
3 Replies

5. UNIX for Dummies Questions & Answers

Create a shell script for write files with 2 parameters

Hello, I'm a newbie in shell script. So, i would like to create a shell script which take 2 IN parameters (PARAM1 and PARAM2). This script need to create 2 files as : I need to create this file /etc/apache2/sites-available/PARAM2 : <VirtualHost *:80> DocumentRoot "/home/PARAM1/www"... (0 Replies)
Discussion started by: chatlumo
0 Replies

6. Shell Programming and Scripting

how to create the files dynamically in c shell script

how can i CREATE a txt file dynamically in c shell: for instance: #! /bin/csh for each i (*) cat>file$i.txt for each j do .... (1 Reply)
Discussion started by: jdsignature88
1 Replies

7. Homework & Coursework Questions

shell script that can create, monitor the log files and report the issues for matching pattern

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write an automated shell program(s) that can create, monitor the log files and report the issues for matching... (0 Replies)
Discussion started by: itian2010
0 Replies

8. Shell Programming and Scripting

How to create a shell script to remove the files on solaris server at 00000hrs?

Hi folks, As per mentioned in the title, how to create a shell script to delete those files from the server at 00000hrs every day? Thanks in advance :) (2 Replies)
Discussion started by: kimurayuki
2 Replies

9. Shell Programming and Scripting

How to create or convert to pdf files from csv files using shell script?

Hi, Can anyone help me how to convert a .csv file to a .pdf file using shell script Thanks (2 Replies)
Discussion started by: ssk250
2 Replies
JAVA2HTML(1)						      General Commands Manual						      JAVA2HTML(1)

NAME
java2html - generates highlighted html-files from Java or C++ source SYNOPSIS
java2html [options] [filename...] DESCRIPTION
This manual page documents how to use java2html. If no arguments are given on the command line of java2html, it reads from stdin and writes to stdout. If invoked with filenames as arguments java2html will write it's output into new files. Names of output files are generated by appending ".html" to the corresponding input filename. Installing as a CGI program java2html can be installed as a CGI program and convert source files on the fly. In order to set this up for apache the webmaster has to add the two lines AddType text/x-java .java Action text/x-java /cgi-bin/java2html to the webserver configuration file. java2html depends on the webserver properly setting environment variable PATH_TRANSLATED to the path- name of the source file. If java2html has been compiled with option -DCOMPRESSION=1 then it will invoke gzip to compress the generated HTML before sending it to the requesting browser. Of course java2html takes care to check if the browser accepts gzip encoding. OPTIONS -- Interpret all following arguments on the command line as filenames. This is useful, if you want to convert files beginning with a '-'. -b filename Insert the file 'filename' after converted data and before HTML footer. See also the -s option. -c Turns off CGI-script detection and HTTP header generation. This is needed to use java2html as a subcommand in another CGI script. -h filename Insert the file 'filename' after the HTML headers and before the converted data. See also the -s option. -i Generate an index only. This will generate a list of references (HREF's) to the labels that java2html creates for your source file. The references are created as list items (<li>) in an HTML list. Each line has the form <li><a href="#name">prototype()</a></li> so they can be used directly as an index list, or further parsed by another script. If you want the index at the top of the source file, you will need a wrapper script like this one: #! /bin/sh echo "Content-type: text/html" echo "" echo "<html>" echo "<head><title>$PATH_TRANSLATED</title>" echo "<meta name="generator"" echo "content="`java2html -V`">" echo "</head>" echo "<body>" echo "<h1>Source of $PATH_TRANSLATED</h1>" echo "<ul>Structures and functions" cat $PATH_TRANSLATED | java2html -isc echo "</ul>" echo "<hr></hr>" cat $PATH_TRANSLATED | java2html -sc echo "</body></html>" exit -n Number lines and label them with 'line' followed by the line number. Empty lines get no label, but the linecounter will count them nevertheless. With this feature you can refer to special lines of code from other parts of the generated file or from external files with a line like this: <A HREF="foo.java.html#line301">Go to line 301</A> -s With this option you can suppress the generation of HTML headers. This is especially useful together with options -b file and -h file. -t title Set the title to 'title'. The default is the filename you converted or "stdin" if reading from stdin. This option is only used if -s is not set. -u Print usage information. -w width sets the WIDTH attribute for HTML tag <PRE>. If this option is not used a default of 80 is assumed. (Currently most browsers are ignoring this attribute). -V reports the version number of java2html. EXIT STATUS
java2html returns 0 on success, 1 if input files are not existing/readable, 2 if output files are not creatable/writable, 3 if invoked with illegal options and 4 if gzip cannot be invoked. AUTHORS
Florian Schintke <schintke@cs.tu-berlin.de> Martin Kammerhofer <mkamm@gmx.net> wrote the CGI feature. Rob Ewan <rob@ewan.com> wrote the indexing feature. SEE ALSO
c2html(1), pas2html(1), perl2html(1). JAVA2HTML(1)
All times are GMT -4. The time now is 03:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy