Hi,
I'm having some trouble reading a file that was 'cat' through a while loop. Can anyone suggest alternatives? what i do is
cat filename|grep *.stuff
while read line
do
echo $line
... and other commands
done
The cat,grep line seems to work correctly, but the script hangs when i add in... (3 Replies)
I am writing a script that is running a loop on one file to obtain records from another file.
Using egrep, I am finding matching records in file b, then outputing feilds of both into another file.
****************************
filea=this.txt
fileb=that.txt
cat $filea | while read line
do... (1 Reply)
Hi All
Can any body help me out.
Amoung tar and gzip whiich unix command is more practical with respect to space management and file restoration.
Eg if I use tar or gzip which will be more helpful to reduce the space and during the file restoration.
Please help me out.
regards... (3 Replies)
STEP 1
# Set variable
FILE=/tmp/mainfile
SEARCHFILE =/tmp/searchfile
# THIS IS THE MAIN FILE.
cat /tmp/mainfile
Interface Ethernet0/0 "outside", is up, line protocol is up
Hardware is i82546GB rev03, BW 100 Mbps
Full-Duplex(Full-duplex), 100 Mbps(100 Mbps)
MAC address... (6 Replies)
Hello,
So I sorted my file as I was supposed to:
sort -n -r -k 2 -k 1 file1 | uniq > file2
and when I wrote
> cat file2
in the command line, I got what I was expecting, but in the script itself
...
sort -n -r -k 2 -k 1 averages | uniq > temp
cat file2
It wrote a whole... (21 Replies)
Hopefully the title summarized what I need help with. I have multiple files that I would like to concatenate in bash.
ie:
cat file1 file2 file3 > bigfile
except I do not want to include the first line from each file (). Any help? Thanks. (6 Replies)
one.txt
ONS.820.log:V 20Oct2010:GP ^ ^
ONS.123.log:V 21Oct2010:GP ^ ^
ONS.820.log:V 30Oct2010:GP ^ ^
want to make new file from existing one with addition.
20Oct2010 User KV001 has name tk003 with buffer- 338-1
21Oct2010 User KV003 has name tk002 with buffer- 338-2
30Oct2010 User KV002... (5 Replies)
Hi all,
I need to create loop script to read full line and append a variable to each line.
cat file
I need the output like below
10.0.0.1,136 1 24 048800 id N4 No_Light
10.0.0.1,137 1 25 048900 id N4 No_Light
10.0.0.1,140 1 28 048c00 id N4 No_Light
10.0.0.1,262 1 38 048e80... (13 Replies)
hi Guys,
Am new to this awesome forum, and yea i need some help here asap thnx :)
i have a directory with over 34000 text files, i need a script that will delete the last line of each of this file without me necessary opening the files.
illustration:-
file1 200 records
file2 130 records... (5 Replies)
Discussion started by: eetang
5 Replies
LEARN ABOUT REDHAT
unix2dos
unix2dos(1) General Commands Manual unix2dos(1)NAME
unix2dos - UNIX to DOS text file format converter
SYNOPSYS
unix2dos [options] [-c convmode] [-o file ...] [-n infile outfile ...]
Options:
[-hkqV] [--help] [--keepdate] [--quiet] [--version]
DESCRIPTION
This manual page documents unix2dos, the program that converts text files in UNIX format to DOS format.
OPTIONS
The following options are available:
-h --help
Print online help.
-k --keepdate
Keep the date stamp of output file same as input file.
-q --quiet
Quiet mode. Suppress all warning and messages.
-V --version
Prints version information.
-c --convmode convmode
Sets conversion mode. Simulates unix2dos under SunOS.
-o --oldfile file ...
Old file mode. Convert the file and write output to it. The program default to run in this mode. Wildcard names may be used.
-n --newfile infile outfile ...
New file mode. Convert the infile and write output to outfile. File names must be given in pairs and wildcard names should NOT be
used or you WILL lost your files.
EXAMPLES
Get input from stdin and write output to stdout.
unix2dos
Convert and replace a.txt. Convert and replace b.txt.
unix2dos a.txt b.txt
unix2dos -o a.txt b.txt
Convert and replace a.txt in ASCII conversion mode. Convert and replace b.txt in ISO conversion mode.
unix2dos a.txt -c iso b.txt
unix2dos -c ascii a.txt -c iso b.txt
Convert and replace a.txt while keeping original date stamp.
unix2dos -k a.txt
unix2dos -k -o a.txt
Convert a.txt and write to e.txt.
unix2dos -n a.txt e.txt
Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt.
unix2dos -k -n a.txt e.txt
Convert and replace a.txt. Convert b.txt and write to e.txt.
unix2dos a.txt -n b.txt e.txt
unix2dos -o a.txt -n b.txt e.txt
Convert c.txt and write to e.txt. Convert and replace a.txt. Convert and replace b.txt. Convert d.txt and write to f.txt.
unix2dos -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt
DIAGNOSTICS BUGS
The program does not work properly under MSDOS in stdio processing mode. If you know why is that so, please tell me.
AUTHOR
Benjamin Lin - ( blin@socs.uts.edu.au )
MISCELLANY
Tested environment:
Linux 1.2.0 with GNU C 2.5.8
SunOS 4.1.3 with GNU C 2.6.3
MS-DOS 6.20 with Borland C++ 4.02
Suggestions and bug reports are welcome.
SEE ALSO dos2unix(1)1995.03.31 unix2dos v2.2 unix2dos(1)