LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 05-22-2009, 10:05 AM   #1
rwalsh26
LQ Newbie
 
Registered: May 2009
Posts: 1

Rep: Reputation: 0
Can't run "cd" with xargs


I'm trying to use xargs within a script as follows and I'm not sure why the command is failing:
rwalsh05@linux-tax7:/usr/lib> ls|grep -E '^python2.'|xargs -t cd
cd python2.5
xargs: cd: No such file or directory
The point is to cd to /usr/lib/python2.5 from /usr/lib. I'm using ls with xargs to pick out the correct directory to change to since /usr/lib contains "python" and "python2.5"
 
Old 05-22-2009, 10:25 AM   #2
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
Code:
cd `ls|grep -E '^python2.'`
 
  


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
WILL THE "1D Stock Cutter" AND "OPTIMIK 2.36c" RUN IN LINUX NOVILINUX Linux - Software 3 01-12-2009 04:30 PM
Why my wireless card "atheros" run only as an acces point in "Master" mode. jardiamj Linux - Wireless Networking 3 11-11-2007 01:12 AM
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 08:42 AM
Several "find -exec" and "find | xargs" questions thanhvn Programming 4 12-02-2005 02:04 PM
Can't run "halt" or "reboot" as user, can somebody help? ro_nicu Slackware 4 11-01-2004 08:57 AM


All times are GMT -5. The time now is 04:12 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