General :: Piping Output Of List To Cp?
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
ADVERTISEMENT
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:
READ_FILE=$(cat $FILE_NAME)
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:
cat $FILE_NAME | $READ_FILE
and various other variants of this. It does not output to std output but neither does anything gets stored into $READ_FILE. I tried:
cat $FILE_NAME >> $READ_FILE
and it arrived at an error of "ambiguous redirect".
View 12 Replies
View Related
Apr 30, 2010
how would you go about piping the output of the shell to notify-osd?
View 5 Replies
View Related
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
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
Code:
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
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.
[Code]...
View 1 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
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
Aug 21, 2010
I am setting up rsyncrypto to create a backup of my user directory. I read that to exclude directories I need to exclude with find and pipe to rsyncrypto.
I am trying to exclude all .svn directories from getting encrypted and synced.
Here is the find command I'm using. I don't see any .svn directories in the output:
find ~/Documents -type d ( -name .svn ) -prune -o -print
But when I pipe the output to rsyncrypto I see lots of .svn directories getting encrypted.
find ~/Documents -type d ( -name .svn ) -prune -o -print | rsyncrypto -vc --trim=3 --filelist - /tmp/Documents/ Documents.keys backup.crt
rewrite the command to exclude from rsyncrypto any files/folders that have .svn in their path?
View 1 Replies
View Related
Oct 31, 2010
kernel 2.6, slackware 12.0mkisofs 2.01If I do 'ls --help|more' all's well. 'mkisofs --help' outputs its help screen, and I can use Shift+PgUp/PgDn to scroll through it. But I can neither pipe it to more or to less, nor redirect it to some file. more is simply ignored. Less, gets into less but only the last screenful is seen. Redirection, i.e. 'mkisofs --help>john.txt' produces an empty file (size= 0).
View 2 Replies
View Related
Feb 11, 2011
Let's say I have a bash script called log.sh. In this script, I want to read in input from a pipe, but I also want to know the command used to pipe input into me. Example:
tail -f /var/log/httpd/error | log.sh
In the shell script, I want to know the command tail -f /var/log/httpd/error.
View 2 Replies
View Related
Aug 11, 2011
I want to attach an analog camera to an old linux computer and directly pipe the /dev/video0 to another computer, where I can use it as a device again (so /dev/video0 should go to /dev/remote0, for example)
(Reason for doing this is that the computer does not have enough power to encode the video)
Is that possible? I've seen people can pipe the data directly from the device over ssh into mplayer, but I need to have some sort of reference point for Zoneminder.
View 2 Replies
View Related
Feb 15, 2011
I am sure this has been covered before, however I do not know which terms to sue for searching for this, so I will try and explain it.
I have a program that I run at startup to connect me to my work VPN, specifically the Cisco VPN client. When running the program, it prompts me for my username and password. I would like to be able to automate the login process by piping the username and password into the program everytime it starts up (username and password cannot be passed as arguments to the program)
Something like echo username | echo password | vpn_script
View 2 Replies
View Related
Mar 29, 2011
I remember there was a command that would allow me to pipe data to an app and the use the | operator to pipe it into yet another app.
foo fooArg | Iforget app1 | app2
I forget what this command is but it pipes the data from foo into app1 and app2.
View 3 Replies
View Related
Mar 13, 2011
How do I slow down the output from the command...
Code:
Or can I go up the page and back down? AND... can I copy all of this to a text file?
View 4 Replies
View Related
Mar 22, 2009
I would like to get the output from 'yum list installed' from a standard CentOS 5.1 32bit installation on a Intel desktop PC. I would like to do a diff with my 'yum list installed' to figure out exactly what my company customized. I know the docs here have the list of added, deleted and updated packages going from 5.0 to 5.1, but is there a complete 'yum list installed' list somewhere?
View 1 Replies
View Related
Dec 27, 2010
How can I convert a file with a lot hex numbers into the decimal?
Example: file1
0x59999
0x5acdc
0xffeff
I want to start $ cat file1 | util | cat >file2 and get file2 with smth like
[Code]...
View 3 Replies
View Related
Jan 7, 2010
list the 'chkconfig --list' in alphabetical order
View 3 Replies
View Related
Jan 28, 2010
one command to list the list of folders/ within the folder.
View 4 Replies
View Related
Aug 6, 2010
I have my .procmailrc file set up to pipe mail to a simple php script I've written. The only thing the script does at this point is echo back a "hello" message. However, procmail does not execute the script properly.
View 1 Replies
View Related
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:
Code:
locate -n 1 wp-config.php | sed 's/wp-config.php/
/g' | sed '/wp-config.php/ d' | sed '/^$/ d'
View 3 Replies
View Related
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
Aug 6, 2010
I have my .procmailrc file set up to pipe mail to a simple php script I've written. The only thing the script does at this point is echo back a "hello" message. However, procmail does not execute the script properly.
Here's my script (/home/webs/site.com/scripts/echo.php):
#!/usr/local/bin/php
<?php
echo "hi.";
?>
View 3 Replies
View Related
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
May 19, 2011
I have my task list in evolution (mainly so it can sync with my phone and online task list) but I always forget to look at the task list. Is there an application or plugin which periodically displays the contents of the tasklist or even better, it briefly displays the most urgent/important tasks when I login? Or anything else which automatically displays the most important tasks. Currently I have to open the task list and look at them (which I usually forget). I do not mean some kind of alarm when the task is due but more a daily reminder of what to do.
View 3 Replies
View Related
Jul 20, 2009
KMail 1.11.4, KDE 4.2.4: I'm migrating from WinXP to Mandriva, and installed KMail at the weekend. Works fine, but I have a niggle - the message list displays headers grouped by month order. I'd like the option of having a simple list (no groups), and suspect that it could be done - but I haven't been able to find out how. I've checked in the Handbook without success, and a search in LQ hasn't turned up anything yet.Any suggestions gratefully received. If this isn't the right place for a KMail query,
View 1 Replies
View Related
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 &
[code]....
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
Apr 29, 2010
I cant seem to get the sound working and when I click on perference then sounds and go to the output selection it has only dummy output as a option.
View 3 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