![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unable to use sort command in Shell Script | racbern | Shell Programming and Scripting | 1 | 04-04-2008 06:25 AM |
| Unable to use 'su' command on FreeBSD6.2 | Praveen_218 | BSD | 3 | 02-28-2008 02:45 AM |
| unable to sent mail in html format by mailx command. | p_prathaban | UNIX for Advanced & Expert Users | 17 | 11-07-2007 03:03 AM |
| unable to display the souce line in gdb | gauri | UNIX for Dummies Questions & Answers | 4 | 04-19-2007 09:36 PM |
| UNable to find ping command | swepaul | UNIX for Dummies Questions & Answers | 3 | 05-30-2005 03:17 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
unable to use command line to cd or ls
Hi:
I have a script with the next command line >set a=(grep -w "something" textfile.txt | grep -w "anotherthing" | cut -c1-11) In the file textfile.txt there are some file names and their paths so when I use this command line it returns a path, for example /directory, and stores in a. when I try >cd $a it comes with the error "Too many arguments", I know that $a is /directory, but if i do >echo $a it returns the command line, this is why i cant use cd $a. is there a way to actually store the file path into the variable and not the command line. So when ever do >set | grep a it will acutally display a /directory I really need you help. Thank you |
|
||||
|
Sorry i probably dont explained my self, what i am trying to do is
>cd $a or >ls $a but none of this work and i have tried >cd echo $a, and >$a | cd both for cd and ls... i know that when i execute just $a i get the path that was copied from the textfile.txt, but when i see what the variable contain it contains the command line, eval grep -w "something" textfile.txt | grep -w "anotherthing" | cut -c1-11. please tell me how to use either cd or ls with the value i get from the execution of the command line (grep -w "something" textfile.txt | grep -w "anotherthing" | cut -c1-11) Thank you |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|