Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Reading from keyboard and sorting Post 302760339 by pandeesh on Thursday 24th of January 2013 12:56:33 AM
Old 01-24-2013
Reading from keyboard and sorting

Hi,

I ahve come across one of the trickier scenario and wanted to check anyone came across this:
i have a file called file1:
Code:
pandi.desktop% cat file1
aa
cc
ds
wwe
bb
pandi.desktop%

I want to read input from keyboard and append into the original file. besides that i want to sort the whole content and write it to a new file.
i want to accomplish this in a oneliner with out using any '&&' or ';'

Code:
sort - file1>>file2

works but the new content added is not being written in the original file. But the new file comes as expected.
Code:
pandi.desktop% sort - file1>>file2
bbs
cc
ff
pandi.desktop% cat file1
aa
cc
ds
wwe
bb
pandi.desktop% cat file2
aa
bb
bbs
cc
cc
ds
ff
wwe

Thanks in advance
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How can I map Unix keyboard for PC keyboard

A Solaris AXI 440 machine with Solaris 8 version. I have PC users who use an emulation to login to the Solaris server. How can I change the keyboard mapping of the Sun keyboard to fit to the PC keyboard ? Any comment will be appreciated. Thanks (1 Reply)
Discussion started by: simhab
1 Replies

2. Linux

mdk 10.2 and keyboard

Hi all, I'm running a mdk 10.2 cooker on my computer. After and update, i've lost the "alt gr" key. How am i supposed to get it back? I've already googled around a bit, testing solutions provided, but nothing can help.. any other suggestions? Thanx all Jason (3 Replies)
Discussion started by: penguin-friend
3 Replies

3. Programming

reading reading data from webpage

hi iam reading data from web page using request socket and curl socket. now my problem is some the web page containg data as a image so how can i read the data from a image. thank,inadvance. sree (3 Replies)
Discussion started by: phani_sree
3 Replies

4. UNIX for Dummies Questions & Answers

what's happening with my keyboard

hi everybody. i ussually use unix and windows, but mainly unix-mandriva distribution, and i have a problem. i have like main os unix, and windows as secondary, and this one is loaded by vmware application. well, when a i load vmware to execute windows afterwards when i return to unix, in this... (1 Reply)
Discussion started by: tonet
1 Replies

5. Shell Programming and Scripting

Perl - Reading keyboard keystroke

Hello All, I wounder if any one know if perl have the ability to run script in the background which record each keyboard keystorke? If yes , how can I implement the part which reading the keyboard keystroke? Is there any moudle that handle it ? Thanks a head Alalush (1 Reply)
Discussion started by: Alalush
1 Replies

6. Shell Programming and Scripting

Reading from Keyboard - Shell Script

How do i read from kb using shell script but i need to read it from same line. Script :- echo "Please Enter Your Choice " read CHOICE But it goes to next line i need it to read it next to Choice and not new line. (4 Replies)
Discussion started by: dinjo_jo
4 Replies

7. UNIX for Dummies Questions & Answers

Problem getting vertical bar with British keyboard layout on US (physical) keyboard

Hi, I've got a bit of a ridiculous problem and wasn't sure where to post it. I need to use the vertical bar for piping in Bash but, as per the title, am using a UK layout on a US (physical) keyboard which doesn't have a key for it in the place I'd expect. I've tried using xbindkeys and Unicode... (7 Replies)
Discussion started by: crunchgargoyle
7 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 12:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy