Sponsored Content
Full Discussion: Truncate File contain
Top Forums Shell Programming and Scripting Truncate File contain Post 302119489 by anbu23 on Wednesday 30th of May 2007 06:43:29 AM
Old 05-30-2007
Code:
var=$( printf "%s" $(<filename) )

Code:
var=$( sed -n '2{p;q;}' filename)

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to truncate a large (8 GB) file

Hello, I need to truncate a large file without deleting and touching it again. i tried the below commands but no use because of the huge file size cat <<! > errors and echo > errors Could someone please help. Thanks, Sateesh (1 Reply)
Discussion started by: kotasateesh
1 Replies

2. Shell Programming and Scripting

truncate file script is not working

Hi All, I have an application which writes log in to a file. The file size becomes around min of 800 MB a day. So I have written a script which backup the file and truncate the original file. My script is like this cp X.log /backup/X.log1 > X.log But the second truncate command... (3 Replies)
Discussion started by: mvenkat_in
3 Replies

3. UNIX for Dummies Questions & Answers

Truncate last <n> characters from a file

I am trying to concatenate 2 files, but before concatenation, I would like to strip off the final character from the first file. The final character is a form feed (ascii 012 / hex 0C) and there will be an unknown number of these characters in the file. It is only the very last one which I want... (1 Reply)
Discussion started by: Gwailo88
1 Replies

4. Shell Programming and Scripting

Truncate multiple file extensions

Hi, I have files with names like file1.txt.txt.txt.txt and file2.txt.txt.txt.txt.txt............ (random infinite number of .txt exist). how to truncate (mv) their names to ones with single .txt extension like file1.txt and file1.txt ? In other words, how to extract the filename upto first... (12 Replies)
Discussion started by: prvnrk
12 Replies

5. Shell Programming and Scripting

Truncate extra contents from file

Hi all, i have a file and i want that after 6th slash "/" in each line of the file the contents gets truncated. Can anyone tell me how to do that !! thanks in advance One more thing how can i change the size of output buffer of console, as i had very long output and its not... (2 Replies)
Discussion started by: glamo_2312
2 Replies

6. UNIX for Dummies Questions & Answers

How to truncate thousands of file names

Folder of e-mails in maildir format had been corrupted. Typical file name is 1246281161.6777.m21JH:2,S . The " :2,S prevents " copying to another device. How can I simply remove the last four characters? (2 Replies)
Discussion started by: steve900
2 Replies

7. Shell Programming and Scripting

Truncate file name to 40 characters

Hello all. I would like to make a script (or two shell scripts) that will do the following. I need the maximum file name and directory name to be 38 characters long. As well, if shortening the file name ends up making all of the files in that directory have the same name, then I would like... (9 Replies)
Discussion started by: marcozd
9 Replies

8. Shell Programming and Scripting

how to recover the truncate file in unix

how to recover the file in unix. Thanks in advance.:wall: (1 Reply)
Discussion started by: krbala1985
1 Replies

9. UNIX for Dummies Questions & Answers

recover the truncate file

hi All, how to recover the truncate file in unix. Thanks!:wall: (2 Replies)
Discussion started by: krbala1985
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:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy