General :: Pipes And Redirect / When To Use Theses?

Jul 31, 2011

Although this is a basic stuff, but still i wonder.
Consider these two examples. code...

I wonder, why doesn't redirection work in first case? when to use redirect and when to use pipes? I have been Linux for a long time, but still this basic stuff baffles me.

View 2 Replies


ADVERTISEMENT

General :: Difference Between Pipes And Redirects

Apr 30, 2011

I've been using pipes and redirects for a long time and just realized that I don't know exactly how they are different. I just know that if you want to store the output in a file, then you use >. Otherwise most of the time you just use |. difference between pipes and redirects?

View 1 Replies View Related

General :: File Descriptors With Pipes

Jun 4, 2010

File descriptors with pipes-Can someone help me with this three situations, what would happen?

a) a process open the same file twice and read through two file descriptors
b) a process does fork and both parent- and child-processes read parallell
c) two processes opens and read from same file.

View 5 Replies View Related

General :: Strange Using Pipes With Ssh As Root?

Jan 31, 2011

has anyone seen this before, when running an ssh command as normal user via ssh i get results:

ssh picolo 'ls -d /var/sadm/pkg/* | egrep "Prod|Dev|UAT" |cut -d/ -f5;uname -r;grep -v "^#" /opt/Tivoli/lcf/dat/1/DMXAdaptiveFileSystem.dat'>>sshnotroot
and it creates file
more sshnotroot
Prod
5.10

[Code]...

View 3 Replies View Related

General :: Use Named Pipes On System Network?

Jun 24, 2010

How to create and use named pipe on linux network.ie
client - my linux machine
server - my fren's linux machine

how to communicate between these two using named pipe created in C? do u have any similar code snippet written in C??

i got one server client application,its working fine on my machine.So i want enhance that code for networking.so help in this...

View 6 Replies View Related

Ubuntu Networking :: Get Rid Of Theses Phantom Wireless Networks?

Mar 8, 2010

I have noticed that on my laptop, when I check for available networks; I get this [picture attached]. However all those networks are non existent at that time when I scan for networks with my desktop PC (which is right next to the laptop). How can I stop these phantom networks from appearing? Note: One of those networks is mine. Even when I have my router switched off, my laptop (running Linux Mint) still says it is available.

View 1 Replies View Related

General :: Program That Reads Multiple Pipes / File Descriptors And Writes To Standard Output

Feb 23, 2011

Is there already a program that reads multiple pipes or file descriptors and writes to the standard output (not splitting lines).Like cat, but reading all files simultaneously and preserving lines.It is needed to avoid coding of select/epoll loops or using multithreading in simple programs. Like "select loop for bash".

View 1 Replies View Related

General :: How Long Do FIFOs - Named Pipes - Stay "open" For

Aug 2, 2011

For example, I have a script that writes the time to a pipe in /etc/pipe. It writes continuously in a while true loop. How long will the data in the pipe be available for reading? If I only decide to read the pipe a day later with cat /etc/pipe, will I get all the time values right from the time I started writing?

Conversely, what if my loop only wrote the time every 10 minutes. Will I be able to access everything a day later?

Finally, pretend my loop writes the time continuously (like my first example) and I read the pipe every 30 minutes. If my computer shuts down right before I read the pipe, will the pipe be empty when I reboot or will it hold all that data?

View 1 Replies View Related

Ubuntu :: Netcat Output Pipes And Redirection ?

May 25, 2010

I'm trying to redirect nc command output but I can't do it.

I have tried this:

And this:

But it seems doesn't work.

View 3 Replies View Related

Networking :: Combine Two Network Pipes For MegaSpeed?

Apr 14, 2011

I have two sources of internet which I want to share and balance the load on. With one source it's easy: plug it into the wireless router and Bob's your uncle. But how would you handle two sources and get load balancing? A switch? Would that really share the load?

View 4 Replies View Related

Programming :: Store Output Of Command With Pipes?

Jan 20, 2011

I need to find one RUNNING word in latest created logs.
and as soon as i will get RUNNING WORD , i have to execute another Unix Command.

I wrote following script code...

View 3 Replies View Related

Programming :: Shellscripting: Pipes And Output Redirection?

Aug 21, 2010

see these simple commands:

Code:
# dbus-monitor --system >> /data/eject.txt
This one works as expected ... dbus-monitor never terminates and whenever it outputs new lines, they are

[code]....

View 3 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

Programming :: Difference Between Message Queues And Named Pipes

Mar 1, 2011

recently I had been to interview where I had a question to be answered, that what are advantages and disadvantages when desiging an application in linux.

View 1 Replies View Related

Server :: Frequent Broken Pipes From SSH Connection After Power Loss?

Apr 19, 2011

I have three machines networked to my desktop which run a bunch of simulations in parallel. As they're running, I connect to them via SSH and screen to keep an eye on the runs and look at the output. They stay usually connected for days at a time. The SSH servers and client are running Fedora 14. Yesterday one of my coworkers accidentally yanked the plug on one of the servers while it was running. When I powered it up again, I started getting some odd connection problems. I couldn't connect to it via SSH initially because I got the Remote Host Identification Changed (RSA host key changed) error. I deleted the key in .ssh/known_hosts, which allowed me to connect, but it denied my password. I then logged into that machine locally, restarted sshd, and removed .ssh/known_hosts again. Now I can log in via SSH without problems. However, the connection dies with a "Write failed: Broken pipe" error every few minutes (as opposed to the other two machines, which stay connected indefinitely).

So my questions are:
1.) why would a power loss affect the behavior of the SSH server?
2.) why do I keep getting broken pipes now?

View 4 Replies View Related

General :: Redirect Set -x To File

Jun 14, 2010

I know that set -x can be used for debugging a shell script.But I want to redirect the output of set -x to a text file.eg: Say test.sh is my script,

View 3 Replies View Related

General :: Redirect Output From Dd Command?

Apr 7, 2010

How to redirect output from dd command to /dev/null ?

View 2 Replies View Related

General :: Redirect Input From One Terminal To Another

May 26, 2010

I have sshed into a linux box and I'm using dvtm and bash (although I have also tried this with Gnu screen and bash). I have two terminals, current /dev/pts/29 and /dev/pts/130. I want to redirect the input from one to the other.And then when I type in /dev/pts/29 the characters I type should show up in /dev/pts/130. However what ends up happening is that every other character I type gets redirected.

View 2 Replies View Related

General :: Redirect Domain Name To Localhost?

Jun 1, 2010

I have a linux test machine which I would like to run a copy of a production webserver. This is a legacy application which does not use a property file for its server name. Throughout the application, the server name is hardcoded (example: open connection to myServer.myCompany.com).

Is there any linux trick which I can use to redirect all requests for a certain host back to localhost? I know in Windows that I can add an entry to the hosts file and have it redirect back to localhost. How do I do this in linux?

View 2 Replies View Related

General :: Why Does Nginx Redirect To A Strange URL

Aug 7, 2010

I had just set up nginx on my server. I have PHP and everything working okay. Except when I try the URL

http://xxx.xxx.xxx.xxx/123

I get redirected to

http://_/123

but when I try the url

http://xxx.xxx.xxx.xxx/123/

It works just as I want it to. How can I get nginx to treat the slashless url decently?

View 2 Replies View Related

General :: Redirect Port To Another Machine?

Sep 29, 2010

My poblem: At work I have a proxy with some closed ports. I need to connect to an Oracle DB on some DB_IP at port 1521. DB_IP is a public IP. What I Have: At home, I have a Linux machine and a Linksys WRT54G Router. What I need: How can I do to communicate a PC at work with DB_IP:1521?

View 1 Replies View Related

General :: How To Redirect Wget To Standard Out

Aug 9, 2011

I have a crontab that wgets a PHP page every five minutes (just to run some the PHP code), and I want to send the output to /dev/null. I couldn't find it in the wget manual.

I'm looking for something like:

wget -o stout http://whatever.com/page.php > /dev/null

View 4 Replies View Related

General :: Squid Redirect To Another Weburl?

Dec 21, 2010

is there any built-in option in squid to redirect a website URL to another URL?

View 2 Replies View Related

General :: Application Redirect To File

Aug 5, 2010

i want to redirect application to file.i m redirecting it by command
konsole -e 'application name' >> applog.txt
but it is not working.

View 6 Replies View Related

General :: Cannot Redirect URL To Another URL When The Link Is Down With Squid

Jun 10, 2010

i have installed squid 2.6 on my centos. i have writen a shell script to ping a network and write to a file. write '1' if network up and '0' if network down. After that,a perl script will read the file and do the redirection.Perl will redirect to a fix URL [URL] if the network down and do nothing when it up. i have put my perl script in squid.conf at url_rewrite_program /my_file_path.

below is my shell script for pinging:

Quote:

#!/bin/bash
while [ 1 ]
do
HOST=143.148.137.134

[code]....

My problem is client browser are not redirect to www.google.com even the network is down. It should go to the fix URL when the user click any URL in network down situation.it just appear cannot resolve host.

View 1 Replies View Related

General :: .htaccess To Redirect All Requests To Another URL?

Apr 16, 2010

I would like to setup .htaccess to redirect every request to one website regardless of folder/filename combination to another URL.For example[URL]

View 1 Replies View Related

General :: Redirect Some Databases To Another Directory?

Jun 22, 2011

My /var/database/ directory is filled..!
Is there any way to redirect some databases to another directory .

View 4 Replies View Related

General :: Redirect All Outputs From /dev/console To /dev/pts/0?

Aug 9, 2010

The serial console is for debugging and will physically disappear when product is mature. However, there are many background processes that may print out statuses/results. These go to /dev/console or serial console. Telnet will be the only way to get a console. I tried netconsole (with netcat) and it works, but it is only for kernel printk messages. I tried "program > /dev/pts/0" and it works also. it would be better if I can just change/add the console /dev/pts/0 to the existing /dev/console.

View 3 Replies View Related

General :: Proxy Server - Redirect ?

Sep 26, 2009

We installed the apache server on oraapps.yan.com. we are planning to use as a proxy server.we have 4 servers inlcuding oraapps.yan.com. Each of them has 3 or more applications. I would like to redirect them to oraapps.yan.com. is it possible. if its how to do that.

View 2 Replies View Related

General :: Redirect Method In Apache

Apr 17, 2010

How to redirect one website to another website in apache.

For example: when i type www.example.com in my browser then it redirect to www.example.com/beta. so how i do in apache, i am using centos 5.

View 1 Replies View Related







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