Sponsored Content
Top Forums UNIX for Dummies Questions & Answers pls help, file name with brackets Post 302599531 by Corona688 on Friday 17th of February 2012 11:32:59 AM
Old 02-17-2012
That won't work either. That will make it all one giant filename instead of a list of files!

The problem isn't how you're using the for-loop, the problem is you're using backticks to shoehorn a list of files into the wrong kind of loop -- you should be using while read. It's also a useless use of cat and useless use of backticks which will do strange things to brackets spaces and the like.

What you should do to read a file line by line, is:

Code:
while read LINE # Note LINE does NOT have a $ here
do
        echo "got line $LINE"
...
done < inputfile

This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

File I/O ERRORS.. PLS HELP..

Hi people, I am having a little problem with my client side of the concurrent programming, i have a makefile, serverside and clientside directories. makefile works well with serverside files. and now when i added the clientside files to the makefile and compiled... it gives me the follwong error.... (0 Replies)
Discussion started by: SwetaShah
0 Replies

2. Shell Programming and Scripting

compare 2 file and print difference in the third file URG PLS

Hi I have two files in unix. I need to compare two files and print the differed lines in other file Eg file1 1111 2222 3333 file2 1111 2222 3333 4444 5555 newfile 4444 5555 Thanks In advance (3 Replies)
Discussion started by: evvander
3 Replies

3. UNIX for Dummies Questions & Answers

pls. help with appening a file

Hi, I wrote a script, but it's not working. Please advise. I want to add the text at the end of the file. Should I use sed or awk. Not sure any thing is fine with me. #!/usr/bin/ksh DATE=`/usr/bin/date '+%m%d%y'` cp -p /etc/inittab /etc/inittab_$DATE... (5 Replies)
Discussion started by: samnyc
5 Replies

4. Shell Programming and Scripting

How to echo Brackets from a file

I'm a beginner of c shell scripting. How I can echo a whole line from a file with bracket in it? Ex. Inside the file.txt abcd efghi This is what inside the c shell set IN_FILE = file.txt set GREP_KEY = 'abcd' set IN_LINE = `grep ${GREP_KEY} ${IN_FILE}` echo $IN_LINE After... (7 Replies)
Discussion started by: zeahr
7 Replies

5. Shell Programming and Scripting

use awk to edit a file..pls help

hey i want to over write the fourth field of a ':' delimited file by first finding the required row by using grep. i have done the following cat file | grep no. | awk -F ':' { $4=count; print $1:$2:$3:$4;} the correct values are being printed but nothin is bein added to the file..please... (5 Replies)
Discussion started by: dhe.arora
5 Replies

6. Shell Programming and Scripting

Delete text between square brackets and also delete those square brackets using sed or awk

Hi All, I have a text file which looks like this: computer programming systems engineering I want to get rid of these square brackets and also the text that is inside these brackets. So that my final text file looks like this: computer programming systems engineering I am using... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

7. Shell Programming and Scripting

parsing characters and number from a big file with brackets

I have a big file with many brackets () in it from which I need to parse number characters and numbers. Below is an example of my file 14 (((A__0:0.02,B__1:0.3)0:0.04,C__0:0.025)2:0.01),(D__0:0.00978,E__2:0.01031)1:0.00362; 15... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

8. UNIX for Dummies Questions & Answers

Pls. help with sudoers file...

Hi, I was asked to create sudoers file for operation team so they can sudo as another user and run few commands. I have updated /etc/sudoers file. User_Alias LEVEL1 = JamesF, dennisW, juanC, steveS, Cmnd_Alias SU_PROD=/bin/su prod, /bin/su - prod Cmnd_Alias SU_NYOP=/bin/su... (2 Replies)
Discussion started by: samnyc
2 Replies

9. Shell Programming and Scripting

Compare the value in between square brackets in file

I wanted to compare the value inside the Squre bracket after Colon ( : ) based on any value(seperated by or operator | ) inside the variable Thread and if match found then wnated to store in output file Input file : 20140320 00:08:43.918 INO 35] - Corporate hub is 20140320 00:08:43.918... (2 Replies)
Discussion started by: nes
2 Replies

10. UNIX for Beginners Questions & Answers

Sort a text file based on names in square brackets

Hi all, I have a text file similar to this: Text More text Etc Stuff That Is Needed Etc Etc This contains over 70 entries and each entry has several lines of text below the name in square brackets. (5 Replies)
Discussion started by: Scally
5 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 03:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy