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
ADVERTISEMENT
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
View Related
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
Oct 14, 2009
I have a list of files in a directory which starts with - or have space.
I need to copy them back without the space or -?
linux1[sim]% ls linux1[sim]% cp ./-* ./*
View 8 Replies
View Related
Mar 29, 2010
I have a script generating some containing multiple lines. But I want to merge all lines using comma separated.
View 6 Replies
View Related
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
Jan 3, 2011
i have 10 vi files . these files contain some system related information. i need to combine the output of all these files into a single file. the final file should contain contents of all these 10 files and the output should be in a tabular format.
is there any command in vi that i can use to create a table ?
View 9 Replies
View Related
Dec 9, 2010
I have a many text files that have XML tags all shoved into 1 line. I want to create a new file that splits each XML tag onto a new line. code...
View 3 Replies
View Related
Feb 2, 2010
How would I list 4 users ID numbered 10, 11, 12 and 13 from my users list and output them to a file busers where their names are numbered by ascending order? How would I accomplish that on a one line command?
View 4 Replies
View Related
May 16, 2011
I have the following code
Code:
ls ~/ | grep ^[[:lower:]]
and would like to take the result of this output and use this as the basis for a cp command to move these files to another folder.
View 3 Replies
View Related
Jun 10, 2011
Relational databases usually have their data over in /var/lib/something. Users are in /home (with data in /var/www). How can I apply a single total disk space quota across all of these independent software systems (file systems, RDBMS, etc.)?
P.S. There's a bet going on around me as to just how awesome SU is. Let's see what you've got.
View 1 Replies
View Related
Jan 21, 2011
I want to write a bash script to run a command and get the last line of the output of that command. For example, the output of "cat /proc/zoneinfo" is:
Code:
Node 0, zone DMA
pages free 3948
min 2
low 2
[Code]....
How can I get the last line in a separated format?
View 4 Replies
View Related
Jan 23, 2010
Ive seen some fixes for this but they all seem to be specific to the particular user's sources.list . . . ..
Code:
Here is Line 54
Code:
View 2 Replies
View Related
Mar 12, 2010
I tried to change the basic toolbar to cairo dock,a tutorial that i found told me to write in terminal gksu gedit /etc/apt/sources.list.d/winehq.listso i write it and a window opened,i couled not find the text that told me(the tutorial i mean)so i closed the window,after that i keep taiking the same error
E: Type �sudo� is not known on line 55 in source list /etc/apt/sources.list
E: The list of sources could not be read.
Go to the repository dialogue to correct the problem.
E: _cache->open() failed, please report.
now whene i got in the winehq.list the text has gone and i take this error in update manager,my software center doesn't work and my terminal whenever i type sudo commands says
E: Type �sudo� is not known on line 55 in source list /etc/apt/sources.list
View 9 Replies
View Related
Jun 25, 2010
I get this error message: E: Malformed line 57 in source list /etc/apt/sources.list (dist parse)
I am pretty new to Ubuntu and dont really understand computer
Here is the sources list (??) as well
View 3 Replies
View Related
May 4, 2011
don't know much, but when I tried to update I get this error:
E: Type 'sudo' is not known on line 52 in source list /etc/apt/sources.list E: The list of sources could not be read.
View 2 Replies
View Related
Jan 14, 2011
The objective is to read a file line by line, add a tab at end of each line and add a value(number) after the tab.
My script:
Code:
Report.tsv before running the script for the first time:
Code:
At the end of first run, each line of Report.tsv gets appended by a space instead of a tab. On the other hand each line of Report.tsv gets appended by tab at the end of second run onwards.
This was realized when Report.tsv was imported in open office spreadsheet. First set of appended values get merged into the original column (Strings) and the subsequent appended values fall in distinct columns.
View 12 Replies
View Related
Sep 1, 2011
There is a problem with my source list (apparently) I'm running 11.04 if that helps.When I try to use apt-get install update for example, I get: "Malformed line 59 in source list etc/apt/sources.list"The same error occurs when trying to access synaptic package manager, it tells me there is a malformed line and the list of sources cannot be read.This error prevents me from apt-getting anything, updating and i suspect it is affecting the software center too.
View 6 Replies
View Related
Aug 8, 2011
I am trying to edit a large bunch of files. Each file has four columns and I want to get rid of the first one, but in each line the number of the first column changes. the number in the first column ranges from 1 digit to 5. For example
1 aaaaa bbbbbb ccccc
23 aaaaa bbbbbb ccccc
15343 aaaaa bbbbbb ccccc
and the desired format would be
aaaaa bbbbbb ccccc
aaaaa bbbbbb ccccc
aaaaa bbbbbb ccccc
View 2 Replies
View Related
Sep 6, 2011
If I grep -nr sumthin * in my source code directory, it also spews out very long lines from minified JavaScript or CSS files. I want to get just the first 80 characters per line. For example, a regular grep gives me this:
css/style.css:21:behavior: url("css/iepngfix.htc")
css/style-min.css:4:.arrow1{cursor:pointer;position:absolute;left:5px;bottom:10px;z-index:13;}.arrow2{cursor:pointer;position:absolute;right:5px;bottom:10px;z-index:13;}.calendarModule{z-index:100;}.calendarFooterContainer{height:25px;text-align:center;width:100%!important;z-index:15;position:relative;font-size:15px!important;padding:-2px 0 3px 0;clear:both!important;border-left:1px solid #CCC;border-right:1px ... etc.
But I'd like to get just this instead:
css/style.css:21: behavior: url("css/iepngfix.htc")
css/style-min.css:4:.arrow1{cursor:pointer;position:absolute;left:5px;bottom:
What Linux command can do this?
View 3 Replies
View Related
Jan 20, 2011
How can I list the following with grep. I want to extract 2 lines fron a text file The fixed known part if it exists will static text and the text line after it will change.
A sample file
.
.
textline1
[code]....
If the fixed part does Not exist how can I return error code 1
View 3 Replies
View Related
Aug 18, 2010
I'm trying to make another file annotation script a little speedier than it has been by the up-until-now proven method of checking the last four characters in a filename before the "dot" (eg .jpg, .psd) against a list of known IPTC categories and Exiv2 command files. It occurred to me that if one script generated a list of files in directory foo, and the same or another script sorted that list by that four-letter tag,then that list could be used(instead of a for/do/done loop on the real files in the folder) by the command-file-matching script to "vomit out" which annotator file would go with file nastynewfile.jpg, f'r'instance. The script I had been using for this task looks like this:
Code:
while read 'line';
do
sp=$(echo $line)
vc=$(echo $sp | cut -d"," -f1)
cv=$(echo $sp | cut -d"," -f2)
[code]....
Where I seem to be stuck is with how to sort the lines in templist, which may be any number of different lengths, from back to front. sort -k looked promising, except it seems only to work the other way round. I thought of invoking a
Code:
q=$(expr length $line); echo $q
n=$[q-8]; echo $n
kind of thing, but that presented the problems of how to sort by those, how to tell sort where to find them (grep?) and how to "stitch them back in" to the original list, which is what I want to sort in the first place.
View 14 Replies
View Related
Jun 2, 2011
I'm trying to remotely run a script on a target machine though the ssh command-line using passwordless login. I know the keys are set up correctly because if I remove the call to the script, the ssh session succeeds and I can log into the remote machine, but when I call the csh script, I don't get any output on the command line. If I call an identical bash script, I do get the output. Specifically, calling line 1 below just returns me to the command line, but running line 2 echo's hello then returns to the command line (both scripts simply contain a single line to echo hello, and both work when run locally on the remote machine). Why do my csh scripts send any output through the ssh link whereas the bash does?
Code:
1) ssh -i /root/.ssh/id_rsa user@remotemachine /tmp/test.csh
2) ssh -i /root/.ssh/id_rsa user@remotemachine /tmp/test.bash Update: I have further determined that nothing I add to the csh gets run either. I've tried touching files and making directories in the scripts, and all gets run using the bash script, but calling the csh script like line 1 above does nothing, nothing is touched or created.
View 4 Replies
View Related
Apr 19, 2011
I am trying to add a line of text to hgrc files for Mercurial Repo'sThe file is found normally in a hidden .hg directory under the repo.I need to add a "deny_read = username" to the end of each of these hgrc files. Suggestions either in shell script format, or a single line?
View 4 Replies
View Related
Oct 10, 2010
I wanted to randomize the comma separated string.String like "test1,test34,test5,test6".And it would be displayed differently when I ran each time.
Expected output like "test5,test6,test1,test34".
View 13 Replies
View Related
Aug 27, 2009
I wrote a script which analysis apache logs. This script generates a tab separated data file. There is two columns in the data. The first column is a file name accessed from remote. The second column shows how many times a file access.
I am looking for a linux command drawing a chart corresponding data.of course, I know that I can draw the chart in OpenOffice Calc. That's not what I need. Because there is some steps to do for a simple chart drawing. If there is a command line tool, then I can write a script that drawing a chart when the data file is updated.
View 6 Replies
View Related
Jan 4, 2010
Logical Memory Space of 4GB is divided in to 3GB User Space and 1GB Kernel Space. Always. Correct?
1. How can we change it? (just changing value of PAGE_OFFSET is okay?)
2. If system have only 256MB of memory (embedded system) and suppose Kernel Modules eat away all the memory during boot. User space will be left will no memory. Is this case possible?
View 2 Replies
View Related
Nov 16, 2009
I have some data ( seperated by semicolon ) with close to 240 rows in a text file temp1. temp2.txt stores 204 rows of data ( seperated by semicolon ). I want to : Sort the data in both files by field1.i.e first data field in every row. compare the data in both files and print out the rows that are not equal in seperate files. I was trying to do this with excel using vlookup, without a great deal of success. hence, i'm exploring the shell script option.
Code:
temp1.txt
1000xyz400100xyzA00680xyz0;19722.83;19565.7;157.13;11;2.74;11.00
1000xyz400100xyzA00682xyz0;7210.68;4111.53;3099.15;216.95;1.21;216.94
1000xyz430200xyzA00651xyz0;146.70;0.00;0.00;0.00;0.00;0.00
[code]....
View 4 Replies
View Related
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
Oct 5, 2010
Does anyone know how I can force single channel sound output? I'm deaf in one ear and want to mix the channels (especially when I need to use headphones).v
View 3 Replies
View Related