Unix C++
Would you like to react to this message? Create an account in a few clicks or log in to continue.

dbt in syntax

+4
akalya
Vineet_More
Christopher
SakeenaHarris
8 posters

Page 2 of 2 Previous  1, 2

Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by jeeva Thu Mar 11, 2010 6:56 pm

oh Sad

jeeva

Posts : 50
Points : 93
Join date : 2010-03-04

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by urvershi Thu Mar 11, 2010 7:00 pm

sorry i didn't check the command with all possible filenames.
christopher is rite it ll display all the filenames starting with list1 or list2.

urvershi

Posts : 21
Points : 70
Join date : 2010-02-26

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by mightyganesh Thu Mar 11, 2010 7:07 pm

try wild carts!

like
Code:
$cat list?
or
Code:
$cat list??

i could get the combined output of list 1 2 3 with list 11 12 13 only by using
Code:
cat list? list??

or by using
Code:
cat list*
mightyganesh
mightyganesh

Posts : 53
Points : 92
Join date : 2010-02-26
Age : 35

http://ganeshguna.blogspot.com

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by urvershi Thu Mar 11, 2010 7:09 pm

but dis command will also display content of files list4,list5,list14,list56 etc..

urvershi

Posts : 21
Points : 70
Join date : 2010-02-26

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by jeeva Thu Mar 11, 2010 7:11 pm

ganesh that output is somewhat similar to what urvershi said.... more generalised than hers

jeeva

Posts : 50
Points : 93
Join date : 2010-03-04

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by jeeva Mon Mar 15, 2010 6:09 pm

got the answer finally

ls |grep ^list[1-2]*$|xargs cat

found by INDHU...

jeeva

Posts : 50
Points : 93
Join date : 2010-03-04

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by akalya Mon Mar 15, 2010 6:18 pm

hey the contents of the file named "list" is also displayed!!!!
and it works even without ^

akalya

Posts : 70
Points : 86
Join date : 2010-03-04

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by jeeva Mon Mar 15, 2010 6:22 pm

@akalya

ya ok.... thats because * denotes 0 or more occurences...
is there a way to specify 1 or more occurence!!!

jeeva

Posts : 50
Points : 93
Join date : 2010-03-04

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by jeeva Mon Mar 15, 2010 6:27 pm

@akalya

actually ^ specifies it should start with "list"
incase if you have "alist" or "blist" etc.. ^ will be useful

found by INDHU again

jeeva

Posts : 50
Points : 93
Join date : 2010-03-04

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by akalya Mon Mar 15, 2010 6:28 pm

ls | grep ^list[1-2][1-2]*$ | xargs cat
this wud work i guess...


Last edited by akalya on Mon Mar 15, 2010 6:31 pm; edited 1 time in total

akalya

Posts : 70
Points : 86
Join date : 2010-03-04

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by akalya Mon Mar 15, 2010 6:31 pm

oh k...thanks indhu...it works!!!!!Smile

akalya

Posts : 70
Points : 86
Join date : 2010-03-04

Back to top Go down

dbt in syntax - Page 2 Empty Re: dbt in syntax

Post by Sponsored content


Sponsored content


Back to top Go down

Page 2 of 2 Previous  1, 2

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum