DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 30th August 2010
Rubiks Rubiks is offline
New User
 
Join Date: Aug 2010
Posts: 1
Thanked 0 Times in 0 Posts
Default Executing Builtin with xargs issue

System: Mac OS X 10.6.4

Problem - returning history id through History command and passing to xargs results in failure.

My complete line is: history | grep -m 1 -v -e"history" | awk '/open.*25-2010/ {print $1}' | xargs !

Which basically prints out the identifier (12) for the full line of
12 open ~/Documents/log/08-25-2010.rtf

With 12 being passed to xargs "!12" i get the error:
xargs: !: No such file or directory

I've confirmed by leaving xargs blank that it does receive 12, because that's all it prints out.

From my reading it seems like the problem could be executing a shell script (per man history) within a execution utility.

I'd appreciate if anyone can confim my theory, if they can provide more useful things to read on the man pages, or contribute more things to test out.

The reason I'm using this complicated line instead of ctrl+r is that it seems ctrl doesn't allow me to use the same patterns as I want to in awk or grep.
Reply With Quote
 

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing web scripts : can't! erehwon OpenBSD General 3 3rd November 2009 10:02 PM
Possible SMP Issue? MetalHead OpenBSD General 1 25th November 2008 03:52 AM
executing commands for all users when X starts with KDM caesius FreeBSD General 2 20th October 2008 09:03 AM
Executing a c program Libran Programming 13 12th August 2008 11:42 PM
RAM issue nikkon FreeBSD General 5 7th May 2008 04:26 AM


All times are GMT. The time now is 09:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick