Ubuntu :: Building A Dictionary With A Bash Script - Piping The Output To A File

Sep 5, 2010

i'm building a dictionary with a bash script. it works perfect except i'd prefer something faster. btw i'm just piping the output to a file.


View 1 Replies


Software :: Alternative To Cat For Piping Dvb Output To File?

May 12, 2010

I am looking for an alternative to cat for streaming the output (ATSC) of a dvb card to a file. cat works fine for a bit but there is some internal variable that reaches a size limit and stops it. As evident by the c error "variable has reached size limit" (sorry for the paraphrase I do not have the error in front of me.) That is ok, a co worker who knows c told me the best thing to do is to find some other utility to do this. cat /dev/dvb/adapter0 > test.mpg is what I am looking to replace. how to pipe this into some sort of compression utility.

View 4 Replies View Related

Ubuntu :: Piping The Output Of The Shell To Notify-osd?

Apr 30, 2010

how would you go about piping the output of the shell to notify-osd?

View 5 Replies View Related

General :: Piping Output Of List To Cp?

May 16, 2011

I have the following 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

Programming :: Piping Cat Output To Variable?

Jan 10, 2010

New to ubuntu and shell scripting in general... currently I stored some data into a text file. Right now, I would like to output the data from the text file and store it into a variable. Here's what I have so far:


This definitely works and READ_FILE has the necessary data. However, this command will trigger an output to std output and I will see data on the screen, which is not what I want. I tried:


and various other variants of this. It does not output to std output but neither does anything gets stored into $READ_FILE. I tried:


and it arrived at an error of "ambiguous redirect".

View 12 Replies View Related

Ubuntu :: Piping Command Output Into Grep As Search Term?

Nov 11, 2010

I want to pipe the output of a command into grep as the search TERM, rather than the text to be searched, like this for example


cat /var/log/auth.log | grep date "&b &d"

so that I only see the lines in auth.log for the current day...but obviously that line doesn't work.... is there a way to do this with grep, or even another command?

View 4 Replies View Related

Programming :: Piping In Bash Using Python?

Dec 16, 2010

I have a bash script that I want to import in to Python, mainly just to see if I can or not. However in the script I do use some piping of commands into sed to trim it down to what I need. When I tried doing it with the os.system() call, it didn't work. The exact error is

sed: -e expression #1, char 16: unterminated `s' command

However the command that was run can be run in bash without an error. Is there a better/another way to do this? For reference the command is:


locate -n 1 wp-config.php | sed 's/wp-config.php/
/g' | sed '/wp-config.php/ d' | sed '/^$/ d'

View 3 Replies View Related

Software :: Save Output Of Bash File?

Jul 11, 2011

I've shell bash file script and I want to save the output into a txt file.I Know ./bash.sh > output.txt will save the result into a file but i want to add something into a bash file and then when the bash file process completed, it save the result into a file and I don't want that overwrite the output into the old file, I want each time i run it, it save the result into a new file.

View 6 Replies View Related

Programming :: Bash - Redirect All Subsequent Std Output To File?

Feb 11, 2010

I have got a script with an outer and inner loop. The inner loop issues loads of echo's which need to be redirected to a log file determined by the outer loop. The obvious solution is to redirect every echo to >$LOG and set LOG in the outer loop.


for f in $FILES ; do
for l in $LINES ; do


it is possible to map stdout to $LOG in the outer loop without having to redirect every subsequent individual command output?

View 4 Replies View Related

General :: Copy Previous Output From Bash Terminal To File?

Oct 26, 2010

I know how to redirect the output of a terminal to a file. For example, if I want to list all the files in ~/Documents and output to a file called test.txt, I would do this: ls ~/Documents > test.txt The question is, can I copy the output to test.txt AFTER I have carried out the command? This would mean that I wouldn't have to know in advance whether I want to copy the output to file. I want to do something like this: ls ~/Documents Then this: <bash command for copying standard output to test.txt>

View 2 Replies View Related

Ubuntu :: Install A French-English Dictionary For Gnome Dictionary Applet?

May 3, 2010

how i can install a french english dictionary for the dictionary applet in gnome

View 1 Replies View Related

Fedora :: Bash Script - Combine Files So That The File Output Is PORT.80 TCP SRC=x.x.x.x United States

Oct 31, 2010

I am working on a script that allows me to convert an IP address to a country name. I have 2 files. One that has text like: PORT.80 TCP SRC=x.x.x.x and the other is x.x.x.x United States. How can I combine these files so that the file output is PORT.80 TCP SRC=x.x.x.x United States?

View 5 Replies View Related

Programming :: Running More Than One Script In A Bash Script And Piping Results To SSH?

Jun 8, 2010

how to set the subject of this up.. but here is what I am trying to accomplish (please keep in mine, this is only my first month playing with ANY Linux programming): My shared web host limits running 2 CRONS or 2 SSH sessions at one time. I need to run more than that.. So, my solution is to run what I need on my home computer, and then push all the results via SSH to my web server.

To keep things timed, I am trying to call 4 bash scripts from inside of 1 bash script... Each bash script has variables I need to export out to the remote (web) server. Being that I can only run 2 SSH or 2 CRON sessions on the remote, it wouldn't do me any good to open up CRON or SSH remotely or locally - either way I'm maxing out. That is why I would like to call 1 final script that takes the output of the 4 bash scripts and does the job.

Main bash calls via CRON every 30 minutes:

Code: ./script_1 &
./script_2 &
./script_3 &
./script_4 &


I need to scp the file saved by wget to the remote server. I also need to pass the SQL statement generated in each script as a command in SSH. I'm lost how to get the info from "script_x" into a string that can be used to SSH - and doing this all inside of ONE SSH command. Would I store the SQL strings in a file and call that in the SSH command line?

If so, what is the command to make sure the variable output in the "script_#" file is sent to a file? Can I call the variable from the main Bash Script? Now - the good news is, I can SSH from my local machine to the remote one.That is about as far as I got.Again - I am so new to this that my ears are still wet. This has been something I have been working on for a while, and I'm just lost at this point.

View 2 Replies View Related

Server :: Sendmail Piping From A Text File

Jan 7, 2011

I'm trying to pipe from a textfile to sendmail.The command I'm using on teh sendmail server is:[root@sendmail-server test]# sendmail to-email-address@relay_server-address < test2.txt.I'm doing this because I was doing this from an aliases file just fine until about three weeks ago. The aliases file suddenly stopped working after the relay server received an inordinate amount of email from the From: address and for the To: address.

View 7 Replies View Related

Ubuntu Networking :: Capturing Data On .pcap File And Piping It

Jun 22, 2011

I have a GPS device which sends in data on port number 5000, i am able to capture the data into a pcap file using tcpdump. Now my problem is, i need to pipe the data into a text file as and when data arrives into the pcap file continuously.I did extensive search, but to no avail. been trying to solve this for the past 3 days. I use the following commands to capture and pipe the data, but that happens only once when i issue the command. I want this to happen continuously as and when the data arrives.

View 1 Replies View Related

Ubuntu :: Building A Frontend In BASH?

Jun 8, 2010

I want to be able to create a Dialog (similar to the one for Winetricks, run it without parameters to see it) with a checklist that tells my script to go out and download whatever scripts of mine I've selected. I also wish to make a GUI for some of my more complex scripts, such as my Backup script so I can have a nice looking menu instead of a text based one.Does anybody know a good place to learn how to do this, with lots of explanations and breakdowns of each part of the script?

View 4 Replies View Related

Programming :: Sorting A Dictionary File?

Nov 1, 2010

I have this dictionary file that has this format:


I want to sort this file so the LONGEST Substitute Values are listed at the top ( so SUBSTITUTE_VALUE_HECL would be first in the list). Obviously I want to keep the related values tagging along with them, so the whole first line would be

Playing with sort This has me pretty close: sort dict.file -k1.1n,1

View 2 Replies View Related

Debian Programming :: Organize A Dictionary Text File?

Nov 9, 2013

I have bought a pdf dictionary, but I would like to convert it to stardict for my ereader.

I have converted the pdf into txt but is quite a bad result. So I need to reorganize a bit the txt.

I'm not a programmer, so I should need you write me a small script (python, sed, bash...) that if at the end of the line there is not a point then the line have to be joined with the following line. Sometimes happens that there is a point even in the middle of the line: in this case the line have to be splitted.

Once last thing: after the first word it's needed a TAB. I have appended a preview of the txt file.

View 2 Replies View Related

Programming :: Bash Ambiguous Redirect - Redirect One Command Output Which Will Be Treat As A Content Of File For Another Command?

Mar 9, 2011

I am trying to grep multiple numbers from file, grep does have the -f option for that.

Code: grep -f <`seq 500 520` /etc/passwd I know this could be done with

Code: for i in `seq 500 520`; do grep "$i" /etc/passwd; done But my question is fare more behind this example. It is possible to redirect one command output which will be treat as a content of file for another command ?

View 2 Replies View Related

Ubuntu :: BASH Script: Odd Output Near IF Statement?

May 31, 2010

For some reason, I get said block of errors when I run my script without arguments:

/home/mark/bin/backup: line 34: [: =: unary operator expected
/home/mark/bin/backup: line 37: [: =: unary operator expected


View 5 Replies View Related

Ubuntu :: Capture And Redirect The Output Using Bash?

Jun 3, 2010

if I'm posting to the wrong forum. Be so kind to tell me where to better ask this question, as I'm really not finding the right words to google for.So, I have a shell application (fdb) which is a Flash debugger. I want to run it using bash script, capture it's output and pass it the commands (it can read from STDIN). The reason I want to do so is that Flash Builder (the IDE for Flash development) is plain stupid when it comes to compilation, and it won't allow me to compile any file in the project... so, I found out that I can make Eclipse to run an external tool. This external tool is my *.sh file whichches the compiler, and then it launches the debugger.The Eclipse console can display the compilation results, or errors. When I run the debugger it can even pass the input from Eclipse console to the debugger, however, the output from the debugger isn't shown.

View 1 Replies View Related

Ubuntu :: Bash Backquotes Join Output?

Feb 7, 2011

I was trying to redirect command output to a variable and realized that all the lines were joined. I tested this additionally with an example:

echo "The contents of this directory are " `ls -l` > dir.txt
and all the lines were joined in the resulting file. What can I do to preserve separate lines?

View 2 Replies View Related

Ubuntu :: Disable Bash Script Massage Output?

Mar 14, 2011

I want to write a script that searches some directory for specific files and then performs action with it. I managed to write a script, but I cannot find how to disable all but echo messages from script Lets say my script is:

comFiles=(`ls -1 *.com | grep ".com" | sed "s/.com//"`)
for comLine in ${comFiles[@]}


doesn't work for me as it doesn't echo lines I need to see

View 3 Replies View Related

Programming :: Bash: Capture All Output To A Log?

Jun 10, 2010

I have a script that generates a bunch of output, including the expansions details provided by: set -v -xI am trying to pipe everything that is displayed to a file, in addition to displaying it on the screen. I've managed to get stderr and stdout into the file, but the expansions are only printed to the screen. Here is what I have so far:sudo -u <user> source my_job.sh |tee my_log.txt 2>&1

View 2 Replies View Related

General :: Bash Command Output?

Feb 12, 2011

What does the following Shell program do ??: () { :| : &} ; :Warning: My computer got hung when i tried to execute this.Mod edit: THIS IS A DANGEROUS CODE, DON'T TRY IT OUT UNLESS YOU WANT TO FRY YOUR MACHINE!

View 2 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:


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

General :: [bash] Output Of One Script Is Input Of Another?

Mar 20, 2010

Now, I have one script called "defcon" defcon gets the current DEFCON level and outputs it using echo.


DEFCON=`curl -s http://members.tripod.com/~Swat_25/defcon.html | sed -n '/^$/!{s/<[^>]*>//g;p;}' | sed '/^$/d' | grep '[12345]$'`
echo "The current DEFCON level is $DEFCON"

The second script ("tweet") updates my twitter account.


curl -s -u USER:PASS -d status="$@" http://twitter.com/statuses/update.xml > /dev/null

What I want to do is be able to update my twitter account with the current defcon status (this is really more of a learning thing than something I actually want to be doing). The original script for tweet replaced $@ with $1, but if I use:

tweet `defcon`

it only uses the first word in the string, similarly if I used $2 or $3.So I changed it to $@. The normal function still works, but typing:

tweet `defcon`

updates twitter with nothing.

EDIT I should mention the /dev/null is there to catch the output of curl, otherwise it won't run silently. It still updates twitter normally with the send to /dev/null

View 1 Replies View Related

General :: Diff The Output Of One Bash Script Against Another?

Jul 6, 2011

I would like to compare the (screen) output of one bash script with the (screen) output of another bash script to ensure the output is exactly the same.The reason for this is that I am receiving a consolidated data feed from an IP address and have moved some of the data feed to a 'new' source IP address. I will turn off the feed from the original once satisfied that the new is receiving the same data. The format of the output from the scripts are exactly the same.

Tried so far
./IDCGRE.sh | grep FX.CK | diff < ./IDCGRE2.sh
./IDCGRE.sh | grep FX.CK | ./IDCGRE2.sh | diff


View 3 Replies View Related

General :: Redirecting Output From A Command Using Bash?

May 10, 2011

I would like to get the command and it's output redirected i have tried using the below but my syntax seems to be incorrect .


View 2 Replies View Related

General :: SQL Command Output To Bash Variables?

Aug 2, 2010

I would like to run a bunch of SQL commands from mysql client in bash. However, I would like to store the output in different variables. E.g.

var1=`mysql -u[user] -p[pass] -D[dbname] -e "Query1"`
var2=`mysql -u[user] -p[pass] -D[dbname] -e "Query2"`


View 5 Replies View Related

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