General :: Create A Single Line Of Output From Multiple Variable Lines Of Input

Feb 3, 2010

I need to create a single line of output from multiple and variable lines of input in a Linux bash shell script.

My input file looks like this:

Where there may be any number of umsecondaryphonenumber lines; if there is not a umsecondaryphonenumber line for a telephonenumber, I don't want to write any output.

So, the output file should look like:

The script I have so far is:

My question is - how do print each of the elements of an array in one record - i.e. what do I put in place of howdoiprintarray?

View 2 Replies


ADVERTISEMENT

General :: Count The Number Of Lines Inside A File And Put The Output Into A Variable?

Feb 1, 2011

i need to count the number of files and put the output into a variable. i used wc -l filename but i couldnt find an option to put the output to variable. example if the number o line is 5, i need the output of echo $x is 5.

View 3 Replies View Related

General :: Multiple Lines At The Command Line?

Feb 22, 2011

I've seen a few tutorials that have commands and parameters on multiple line, like the one below:

Code:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start

I can copy and paste this in Putty, but what if I want to manually type it? If I press return, the first line gets processed, so how do I insert a new line?

View 4 Replies View Related

General :: List Output In Single Line (space Separated)?

Feb 1, 2011

got a situation where if i process a command i get a numeric output something like below:

for example:

# cat example.txt
856589
856470
987866
656658
876897

now i want to see this output in single line like below:

856589 856470 987866 656658 876897

how do i get this?

View 10 Replies View Related

General :: Create A Video DVD With Multiple Titles From A Single-titled DVD?

Apr 24, 2010

I have an unencrypted DVD that is one big title, ie you cannot skip next / prev. What I want to do is reauthor the DVD with title at certain points, so that I can skip next / prev when watching it.

I'm using Ubuntu 8.10

View 1 Replies View Related

Ubuntu Servers :: Bash Variable Multiple Lines - Store In $a?

Apr 30, 2010

I have this script:

Code:
a=awk'{print $8}' f1.txt

How can I make it store lines in $a ? In the way above it creates one big line.

View 2 Replies View Related

Software :: Read Multiple Lines From User Input In C?

Feb 26, 2010

in c how to read multiple lines from user input

using scanf it is not possible and using gets we can able to read one line at a time
hoe to read multiple lines at a time from user input....

View 1 Replies View Related

General :: Create A Multiple Files By Reading A Input File And Changing The Contents?

Sep 16, 2009

Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .

I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.

I want to create a mutiple output files with each file having a seperate code which is stored in text file and create XYZ_222_999_YYYYMMDD_1.TXT . and add date in the contents next to series of numbers .Like this

Before change the file looks like this

file name XYZ_111_999_YYYYMMDD_1.TXT

001,19SEP2009-14:05:05,000000003
1234
4567
6785
END_OF_DATA

[Code]....

View 4 Replies View Related

Programming :: Take A Single Line Of Input From User In Shell Script?

Mar 10, 2011

How do i take a single line of input from the user in a shell script?

View 3 Replies View Related

Programming :: Multiple Input Into Seq Command From Pipe - Single Column Unique Numbers

May 13, 2011

Have this script which is reading in a series of files, one at a time with while-do-done loop, each file goes through various greps/awk's where this info is then saved to various files for later use. i.e....

Script is being run on Linux Red Hat,

In one of the grep/awk's the output (currently) are 2 columns (min max), i.e....| awk '{print $1, $2}' | sort -u which outputs (e.g.)

The number of "min max" pairs varies from file to file. Want to output a single column of unique numbers from the min max pairs & get the number of them for input to a file...i.e...

Where <PROCESS> is some process/technique that will generate a single column of integers (increment of 1) to pipe into the next one (sort -u)

i.e. (example from above)

Have tried command seq - only works for single pair input i.e.

Is there any command like seq etc which will output a single column based on a input of min max numbers (increment 1) to pipe onwards to next command?

View 4 Replies View Related

Networking :: Specifying Output Int Based On Input Int And Source IP On Multiple 802.1q?

May 4, 2011

I have a pair of interfaces bringing in traffic from multiple vlans each. I need to route or forward traffic to and output interface based on the physical interface and source IP address in the packet.I have multiple ip rules to send traffic to custom routing tables and each of those custom tables had a default route out the appropriate interface, but traffic isn't flowing. Afterwards I tried using iptables and put an ACCEPT any statement in every chain of every table. What am I missing, ebtables maybe??

View 1 Replies View Related

Ubuntu :: Use Multiple Audio Output Devices On Single Machine

Jun 14, 2010

I always keep my headphones as well as my 2.1 speakers connected simultaneously on my PC (Gigabyte motherboard). Both these audio devices work fine simultaneously on my Windows 7, but in Ubuntu, only my headphones work, speakers don't work at all. I tried changing some settings in SOUND PREFERENCES as well as ALSA SOUND MIXER, but not luck so far.

View 1 Replies View Related

Debian :: Redirect Output Sound To Input (mic Or Line-in)

Jan 22, 2011

I want to compare the quality of a sound file (voice) before and after its transmission via a softphone (sjphone in my case). For this, i need to redirect the sound played, to the sound input (microphone or line-in).

View 1 Replies View Related

Ubuntu :: Update A Single Line Of An Output In A Bash Script?

Nov 1, 2010

This is more of a bash or scripting How do you update a single line of an output in a bash script. I have had to do the:

[Code]..

Is there a way to clear only a single line of output? my goal is to mimic a single line animation, much like the '=>' '==>' ' ===>' we have all seen in other programs.

View 3 Replies View Related

Ubuntu Servers :: NFS - Exporting Multiple FS With Single Line?

Jul 26, 2011

I'm using my home server to netboot into live CDs. To summarize that article, netbooting a liveCD system involves passing an NFS host:/path in kernel's command line, which is subsequently mounted as /cdrom on the live system. The article mentions copying the contents of the iso image to a place on the hard drive, but I see no reason for this, since the contents need to be read-only anyway, which is easy to achieve by mounting the iso through a loop device:

Code:

# mount
...
/dev/loop0 on /mnt/kubuntu-lucid-amd64 type iso9660 (ro)
/dev/loop1 on /mnt/kubuntu-natty-amd64 type iso9660 (ro)

[code]....

Now, I am using NFS to mount a regular (rw, HDD) directory which I use as a network drive and I can mount any subdirectory and still access all the files within, ie. when I export /data on the server, I can still mount /data/downloads on the client:

Code:

server:# exportfs
/data 192.168.1.4/32
client:$ sudo mount -t nfs 192.168.1.1:/data/downloads /mnt/netshare

[code]....

Is it possible to export just /mnt and be able to mount any/all of the subdirectories? NFS doesn't like going across multiple file systems:

Code:

server:# ls -al /mnt/kubuntu-natty-i386/
total 3532
dr-xr-xr-x 11 root root 4096 2011-04-27 11:29 .
drwxr-xr-x 7 root root 4096 2011-07-25 21:46 ..

[code].....

When I try to export just /mnt and mount /mnt/kubuntu-natty-i386 on the client, the mount succeeds but the mounted directory is empty.

View 1 Replies View Related

OpenSUSE :: Count Lines In Multiple Text Files From Command Line?

Apr 27, 2010

I want to (from the command line) be able to counte lines in a bunch of files of a specific type in a folder and all its sub-folders. How would I do this?

View 1 Replies View Related

Programming :: Multiple Line Pattern Matching And Variable Extraction?

Oct 19, 2010

I have this complex log file filled with entries like

test1-G1/0/0-100-QOS-7001923-ROUTING (ClassMap)
Action: Resolved New
sysName: test1.local

[code]...

View 1 Replies View Related

Slackware :: Cannot Create Bluetooth Connection - Input / Output Error

Mar 3, 2010

I am having getting bluetooth working. I am using a home built computer, AMD Athalon 64, 1.5 gig ram, Slackware 13_64, up to date. I have bluez-firmware-1.2-x86_64-1, bluez-hcidump-1.42-x86_64-2, bluez-libs-3.36-x86_64-2, bluez-utils-3.36-x86_64-7 installed. I have a USB Micro Adapter 2.1 from IOGear and a Motorola S9-HD stereo headset.

This is what happens when I try to connect:
root|/home/john # hcitool scan
Scanning ...
00:23:D7:DE:8D:DFGravity
00:0D:FD:2A:BB:42Motorola S9-HD
root|/home/john # hcitool cc 00:0D:FD:2A:BB:42
Can't create connection: Input/output error

I am finding the headset but can't connect to it. I have the password from the headset in the default file of /etc/bluetooth/passkeys.

View 2 Replies View Related

Ubuntu :: OpenOffice: Create Multiple TextBox Input Areas?

May 17, 2010

Maybe this isn't the right place, BUT: How can I create an OO Writer template with about 20 input Text Areas? I can make one, and then I thought I could use COPY and PASTE to dupe it in the other places, but it didn't work. I hate to spend all that time creating the other 19 identical boxes.

View 3 Replies View Related

Ubuntu :: Use Multiple Cut Command To Print Output On A Line?

Apr 27, 2010

how to use multiple linux cut comman to display on same line ?

e.g ls -il | cut -f6 d:
ls - il cut -f9 -d:

The linux script output is

filename
123

How to use cut to display on same line ?

View 1 Replies View Related

General :: Create An Environment Variable With The PRINTER Variable?

Apr 16, 2011

I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)

View 3 Replies View Related

General :: Search Multiple Words In Multiple Lines?

Dec 16, 2010

How to search multiple words in multiple lines, inside a directory including sub-directory? Pls. give easy example. I want to search the files (in /xx folder and all subfolders) that have header.h included and used x() function. I tried $grep -r "header.h" | grep -r "x(" /Folder/subfolder/ > search.log

View 7 Replies View Related

General :: Remove Lines With Variable Value?

Jul 20, 2011

I have model output data in ascii format. It contains thousands of lines. The output file contains multiple text lines with variable values. here I copy-paste some of it's contents.

Code:

73438 170 23:53:20 3.481328E-03 1.824611E+04 1.824612E+04 1.333962E+16
73439 170 23:56:40 3.481210E-03 1.824611E+04 1.824612E+04 1.333962E+16
73440 171 00:00:00 3.481093E-03 1.824611E+04 1.824612E+04 1.333962E+16

[code]....

i want to remove the lines starting by WRT and DEF.

View 7 Replies View Related

Programming :: Create A Simple Program With Will Continually Read Input From The User Until They Enter A Blank Line?

Apr 6, 2011

basically i have to create a simple program with will continually read input from the user until they enter a blank linei know how to read in certain input but not sure how to get it continually in a loop

View 2 Replies View Related

General :: Grep Lines Containing A Certain String PLUS The Line Following That Line?

Sep 1, 2009

I have a dataset (see example below) that I would like to go through and copy all lines containing a certain string ("LGIG") plus the line immediately following that line to a new file. I have no problem grepping lines containing the string LGIG but I'm lost how to translate that to line number and shift up one line number for each instance of that string.

Example input file:

[code].....

View 5 Replies View Related

General :: Scripting - Feed An Input File Into An If Statement Line-by-line

Dec 23, 2009

I am trying to write a script that takes an input file ($FileName) and an intermediate file ($FileName.info) and removes lines from $FileName if the value in $2 of $FileName.info is <75.

I can't figure out how to feed only one line of the .info file to the if statement at a time so that it will perceive it as an integer instead of a list.

The error I am getting now is ./script.sh: line 6: [: : integer expression expected

Sample input $FileName

Code:

Code:

Code:

Script so far:

Code:

View 10 Replies View Related

General :: Bash: Input Password Into A Variable?

Aug 22, 2010

I'm basically setting up two sshfs mounts and I have it set up so I run one command but type my password twice.Is there an easy to way to input a password using bash and pass that variable to another process asking for a password?

View 5 Replies View Related

General :: How To Get Invalid User Input Into Variable?

Apr 8, 2010

I have a script in which it searches the password file for a username based on the user's input. Is there a way I can take the bad input and keep it in a variable. (one that keeps adding all the non-existent users)so how would I get non-existent users into another variable?

View 9 Replies View Related

OpenSUSE :: Web - Screen Loads And After Initial First Few Lines Breaks Up Into Multiple Repetitions Of Lines

Apr 22, 2011

I have been experiencing a problem where the screen loads and after initial first few lines breaks up into multiple repetitions of lines. Reloading helps but has to be repeated when pageing down. Mail is no problem; it is supplied by my network provider. OS is openSUSE 11.2 which I update when advised. Below is a sample from the error console:

[Code]...

View 1 Replies View Related

General :: Getting The Line Of String From Previous Pipe Output By Line Number?

Feb 8, 2010

After running the following command, I get:

[root@yukiko /]# find / -iname .bashrc
/home/clamav/.bashrc
/home/vpopmail/.bashrc
/etc/skel/.bashrc
/root/.bashrc

But I would like to have a command that prints a specific line by supplying the command with the line number, for example:

[root@yukiko /]# find / -iname .bashrc | getline(2)
/home/vpopmail/.bashrc

Is there such a command on CentOS?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved