LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-10-2013, 11:28 PM   #1
Grtyop
Member
 
Registered: May 2013
Location: Over the Rainbow..
Distribution: LinuxMint , RedHat
Posts: 31

Rep: Reputation: Disabled
Questions about <at> command.


When I use echo "linux" > /home/trax/Desktop/qqq | at now +1 minute , it outputs the echo to the qqq file immediately instead of 1 minute, but when I do it via the standard input method which uses the at> and ctrl+D , it works.

Why is this so ?

Thanks.
 
Old 08-10-2013, 11:46 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
From the man at output (emphasis added):
Code:
DESCRIPTION
       at  and  batch  read  commands from standard input or a specified file which are to be executed at a later
       time, using /bin/sh.
I suspect that linux is not a command on you system, and, anyhow, the output produced by the echo command you posted has been redirected to the qqq file, so nothing is passed to the pipe. (You need a tee command if you want it to go to both the file and the pipe.)
 
1 members found this post helpful.
Old 08-11-2013, 12:32 AM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,210

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
The command did exactly what you told it to do. But that wasn't what you wanted it to do. You were not sending that echo command down the pipe to the at command like you think you were. You were telling the echo command to run immediately, and then piping the output of that (which was nothing, since you have previously redirected said output to the qqq file) to "at". So you were effectively telling "at" to do nothing, 1 minute from now. Which is precisely what it did.

I suspect this will do what you wanted:

Code:
echo 'echo "linux" > /home/trax/Desktop/qqq' | at now +1 minute
 
1 members found this post helpful.
Old 08-11-2013, 02:54 AM   #4
Grtyop
Member
 
Registered: May 2013
Location: Over the Rainbow..
Distribution: LinuxMint , RedHat
Posts: 31

Original Poster
Rep: Reputation: Disabled
Thanks alot haertig, I understood your explanation . The placement of "" is very important haha.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions about źdd command╗ UndertakerzZz Linux - Newbie 5 01-26-2011 07:07 AM
Some Linux command questions jacatone Linux - Newbie 3 02-08-2009 01:23 PM
Questions about last command output linuxfia Linux - Security 13 10-31-2008 03:53 PM
Questions with make command abk4523 Linux - Software 3 01-04-2006 05:22 PM
Command questions The Joker Linux - General 2 05-03-2005 10:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration