[SOLVED] Piping Problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [SOLVED] Piping Problem
# 1  
Old 10-22-2011
[SOLVED] Piping Problem

Hey,
I want to create a new file (devices) with the 39th and the 40th character of the line wich is in the array line and in the file drivers.
But unfortunately my try doesn't work:
Code:
sed -n '$line[0]p' drivers | cut -c 39-40 | echo >>devices

Perhaps one of you can help me. Thank you!

emoly

---------- Post updated at 01:24 PM ---------- Previous update was at 12:02 PM ----------

fixed it by myself

Code:
 echo $(sed -n '$line[0]p' drivers | cut -c 39-40) >>devices


Last edited by radoulov; 10-22-2011 at 05:35 PM.. Reason: Marked as solved.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Problem piping find output to awk, 1st line filename is truncated, other lines are fine.

Today I needed to take a look through a load of large backup files, so I wrote the following line to find them, order them by size, and print the file sizes in GB along with the filename. What happened was odd, the output was all as expected except for the first output line which had the filename... (4 Replies)
Discussion started by: gencon
4 Replies

2. Shell Programming and Scripting

[Solved] SFTP problem

Hi, I'm new to sh scripting and have the following problem. I have a script to sftp that is now working with ssh key. But i need to change this, i wan't to sftp with a password. I have the following script, tried a lot to make a variabel for the password. But i can't make it work ... (2 Replies)
Discussion started by: kvhindex
2 Replies

3. Homework & Coursework Questions

Unix Piping Problem

Hey guys. I'm very new to Unix. I'm pretty fluent in Java and C, but I have never actually used Unix for anything. I am in an Operating Systems course now and I have an assignment to write a piece of code that involves forks and piping. I'm stuck. 1. The problem statement, all variables and... (6 Replies)
Discussion started by: itsjimmy91
6 Replies

4. Shell Programming and Scripting

[solved] Problem with find

hi All, I am using the command find /home/mqm/check/ -mtime +1|wc -l to get a count of the files older than a day under the check directory. But instead of getting the count of the files under check directory I m getting a count including the check directory itself. Can someone please tell... (0 Replies)
Discussion started by: jayii
0 Replies

5. Shell Programming and Scripting

piping problem with xargs

I'm trying to pipe the output from a command into another using xargs but is not getting what I want. Running this commands: find . -name '33_cr*.rod' | xargs -n1 -t -i cut -f5 {} | sort -k1.3n | uniq | wc -l give the following output: cut -f5 ./33_cr22.rod cut -f5 ./33_cr22.rod ... 9224236... (7 Replies)
Discussion started by: ivpz
7 Replies

6. Shell Programming and Scripting

[Solved] Help piping tail to read STDIN

Hello everybody, I need some help here. I have a log file that gets updated every hour approximately. I want to make some processing on each line which is added in the log file with a program written in PERL. The problem is that I don't see anything when a line is added in the log file. I... (6 Replies)
Discussion started by: Samb95
6 Replies

7. AIX

Problem Solved

Generally, most people, I guess, go from 5.3 ML4 Directly to TL 7. So they may never run into this issue. For the rest of us, here is the resolution of my problem in going from ML6 to TL7. Apparently with the change from ML to TL IBM added a "BuildDate Verification" routine into... (1 Reply)
Discussion started by: mrmurdock
1 Replies

8. Shell Programming and Scripting

Problem in piping the file(s) content from zip files

Hi friends I have a zip file 1.zip which contains three text files a.txt b.txt c.txt I want to grep some text(keyword) in those 3 files without extracting all the three files to a local directoryusing the command, unzip -p 1.zip |grep "search text" >result.txt The Output file is... (2 Replies)
Discussion started by: ks_reddy
2 Replies

9. Shell Programming and Scripting

problem piping input to script with echo

I am trying to have a script run without interaction from the command line. So in my script i have a line like this echo -e "\n\n\ny\ny\n" | ./script the goal being the ability to mimic 3 Enter presses and 2 'y/n' responses with 'y' followed by enter. For some reason tho, it is not... (1 Reply)
Discussion started by: mcdef
1 Replies

10. Shell Programming and Scripting

problem with exit code when piping

i am writing a script to perform some mysqldumps and gzip them. The problem I am running into is that if the user specifies a database that doesn't exist, the error the mysql engine produces is still piped into gzip, and the exit code returned is 0. If I don't pipe into gzip, an exit code... (4 Replies)
Discussion started by: bitoffish
4 Replies
Login or Register to Ask a Question
CY(4)							   BSD Kernel Interfaces Manual 						     CY(4)

NAME
cy -- Cyclades Cyclom-Y serial driver SYNOPSIS
For one ISA card: device cy In /boot/device.hints: hint.cy.0.at="isa" hint.cy.0.irq="10" hint.cy.0.maddr="0xd4000" hint.cy.0.msize="0x2000" For two ISA cards: device cy In /boot/device.hints: hint.cy.0.at="isa" hint.cy.0.irq="10" hint.cy.0.maddr="0xd4000" hint.cy.0.msize="0x2000" hint.cy.1.at="isa" hint.cy.1.irq="11" hint.cy.1.maddr="0xd6000" hint.cy.1.msize="0x2000" For PCI cards: device cy options CY_PCI_FASTINTR No lines are required in /boot/device.hints for PCI cards. Minor numbering: 0bMMMMMMMMMMMMMMMMxxxxxxxxOLIMMMMM callOut Lock Initial MMMMMMMMMMMMMMMM MMMMMMinor DESCRIPTION
The cy driver provides support for Cirrus Logic CD1400-based EIA RS-232C (CCITT V.24) communications interfaces (ports) on Cyclades Cyclom-Y boards. Each CD1400 provides 4 ports. Cyclom-Y boards with various numbers of CD1400's are available. This driver supports up to 8 CD1400's (32 ports) per board. Input and output for each line may set independently to the following speeds: 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, or 115200 bps. Other speeds of up to 150000 are supported by the termios interface but not by the sgttyb compati- bility interface. The CD1400 is not fast enough to handle speeds above 115200 bps effectively. It can transmit on a single line at slightly more than 115200 bps, but when 4 lines are active in both directions its limit is about 90000 bps on each line. Serial ports controlled by the cy driver can be used for both `callin' and `callout'. For each port there is a callin device and a callout device. The minor number of the callout device is 128 higher than that of the corresponding callin port. The callin device is general pur- pose. Processes opening it normally wait for carrier and for the callout device to become inactive. The callout device is used to steal the port from processes waiting for carrier on the callin device. Processes opening it do not wait for carrier and put any processes waiting for carrier on the callin device into a deeper sleep so that they do not conflict with the callout session. The callout device is abused for handling programs that are supposed to work on general ports and need to open the port without waiting but are too stupid to do so. The cy driver also supports an initial-state and a lock-state control device for each of the callin and the callout "data" devices. The minor number of the initial-state device is 32 higher than that of the corresponding data device. The minor number of the lock-state device is 64 higher than that of the corresponding data device. The termios settings of a data device are copied from those of the corresponding initial-state device on first opens and are not inherited from previous opens. Use stty(1) in the normal way on the initial-state devices to program initial termios states suitable for your setup. The lock termios state acts as flags to disable changing the termios state. E.g., to lock a flag variable such as CRTSCTS, use stty crtscts on the lock-state device. Speeds and special characters may be locked by setting the corresponding value in the lock-state device to any nonzero value. Correct programs talking to correctly wired external devices work with almost arbitrary initial states and almost no locking, but other set- ups may benefit from changing some of the default initial state and locking the state. In particular, the initial states for non (POSIX) standard flags should be set to suit the devices attached and may need to be locked to prevent buggy programs from changing them. E.g., CRTSCTS should be locked on for devices that support RTS/CTS handshaking at all times and off for devices that do not support it at all. CLOCAL should be locked on for devices that do not support carrier. HUPCL may be locked off if you do not want to hang up for some reason. In general, very bad things happen if something is locked to the wrong state, and things should not be locked for devices that support more than one setting. The CLOCAL flag on callin ports should be locked off for logins to avoid certain security holes, but this needs to be done by getty if the callin port is used for anything else. Kernel Configuration Options The CY_PCI_FASTINTR option should be used to avoid suboptimal interrupt handling for PCI Cyclades boards. The PCI BIOS must be configured with the cy interrupt not shared with any other active device for this option to work. This option is not the default because it is cur- rently harmful in certain cases where it does not work. FILES
/dev/ttyc?? for callin ports /dev/ttyic?? /dev/ttylc?? corresponding callin initial-state and lock-state devices /dev/cuac?? for callout ports /dev/cuaic?? /dev/cualc?? corresponding callout initial-state and lock-state devices /etc/rc.serial examples of setting the initial-state and lock-state devices The first question mark in these device names is short for the card number (a decimal number between 0 and 65535 inclusive). The second question mark is short for the port number (a letter in the range [0-9a-v]). DIAGNOSTICS
cy%d: silo overflow. Problem in the interrupt handler. cy%d: interrupt-level buffer overflow. Problem in the bottom half of the driver. cy%d: tty-level buffer overflow. Problem in the application. Input has arrived faster than the given module could process it and some has been lost. SEE ALSO
stty(1), termios(4), tty(4), comcontrol(8), pstat(8) HISTORY
The cy driver is derived from the sio driver and the NetBSD cy driver and is currently under development. BUGS
Serial consoles are not implemented. BSD
May 24, 2004 BSD