[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
lsdev(1M)																 lsdev(1M)

NAME
lsdev - list device drivers in the system SYNOPSIS
driver | class] block_major] char_major] major] [major ...] DESCRIPTION
The command lists, one pair per line, the major device numbers and driver names of device drivers configured into the system and available for invocation via special files. A in either the block or character column means that a major number does not exist for that type. If no arguments are specified, lists all drivers configured into the system. If the option is specified, will not print a heading. This option may be useful when the output of will be used by another program. The and options are used to select specific device drivers for output. If more than one option is specified, all drivers that match the criteria specified by those options will be listed. These search options are divided into two types: name search keys (the and options) and major number search keys (the and options). If both types of options are present, only entries that match both types are printed. The same type of option may appear more than once on the command line with each occurrence providing an ORing effect of that search type. The and options may not be specified at the same time. The ability to process major arguments is provided for compatibility and functions like the option. Options List device drivers that match class. List device drivers with the name driver. List device drivers with a block major number of block_major. List device drivers with a character major number of char_major. List device drivers with either a character major number or block major equal to major. DIAGNOSTICS
The and options may not be specified at the same time. A major number is malformed or out of range. EXAMPLES
To output entries for all drivers in the class: To output entries that are in the class that have either a block or character major number of To get the character major number of into a shell environment variable: WARNINGS
Some device drivers available from the system may be intended for use by other drivers. Attempting to use them directly from a special file may produce unexpected results. A driver may be listed even when the hardware requiring the driver is not present. Attempts to access a driver without the corresponding hardware will fail. only lists drivers that are configured into the currently executing kernel. For a complete list of available drivers, please run (see sam(1M). DEPENDENCIES
Since relies on the device driver information provided in a routine, may not list drivers installed by other means. AUTHOR
was developed by HP. SEE ALSO
sam(1M). Section 7 entries related to specific device drivers. lsdev(1M)