dbt in syntax
+4
akalya
Vineet_More
Christopher
SakeenaHarris
8 posters
Page 1 of 2 • 1, 2
dbt in syntax
cat list2
grapes
prunes
dates
almonds
[@oracleclient ~]$ cat list1
mango
orange
pineapple
lemons
[@oracleclient ~]$ cat list[^12]
mango
orange
pineapple
lemons
grapes
prunes
dates
almondslemons
grapes
prunes
dates
almond
#what does it print, i.e; the cat list[^12]
grapes
prunes
dates
almonds
[@oracleclient ~]$ cat list1
mango
orange
pineapple
lemons
[@oracleclient ~]$ cat list[^12]
mango
orange
pineapple
lemons
grapes
prunes
dates
almondslemons
grapes
prunes
dates
almond
#what does it print, i.e; the cat list[^12]
SakeenaHarris- Posts : 7
Points : 13
Join date : 2010-03-08
Re: dbt in syntax
list[^12] points to files named ("list"+any one of the characters enclosed in brackets).
Re: dbt in syntax
Christopher Can you please explain in more detailed fashion??
Vineet_More- Posts : 27
Points : 31
Join date : 2010-02-26
Re: dbt in syntax
it takes all the possible combinations as arguments.
for example,
abc[def] refers to all the files starts with "abc" and fourth character is any one of the character enclosed in square bracket.
for example,
abc[def] refers to all the files starts with "abc" and fourth character is any one of the character enclosed in square bracket.
- Code:
cat abc[def] ==> cat abcd abce abcf
dbt in syntax
but its displaying both the lists list1 and list2 along with list2 again......
SakeenaHarris- Posts : 7
Points : 13
Join date : 2010-03-08
Re: dbt in syntax
does cat list[^12] work????
i'm getting as....
[335802@oracleclient ~]$ cat list[^210]
cat: list[^210]: No such file or directory
but if i give
[335802@oracleclient ~]$ cat list["^210"]
hello
me
hi
everybody
mango
orange
pineapple
lemons
grapes
prunes
dates
almonds
contents of the files list0 list1 list2 are printed in order...(ie always list0 first followed by list1 and list2)
i'm getting as....
[335802@oracleclient ~]$ cat list[^210]
cat: list[^210]: No such file or directory
but if i give
[335802@oracleclient ~]$ cat list["^210"]
hello
me
hi
everybody
mango
orange
pineapple
lemons
grapes
prunes
dates
almonds
contents of the files list0 list1 list2 are printed in order...(ie always list0 first followed by list1 and list2)
akalya- Posts : 70
Points : 86
Join date : 2010-03-04
Re: dbt in syntax
m gettin this
[335814@oracleclient ~]$ cat >list1
this s list 1
hi
hello
where are you
[335814@oracleclient ~]$ cat >list2
this is list 2
apple
orange
grapes
[335814@oracleclient ~]$ cat >list3
this is list 3
potato
beans
peas
[335814@oracleclient ~]$ cat list[^12]
this is list 3
potato
beans
peas
[335814@oracleclient ~]$ cat list[^13]
this is list 2
apple
orange
grapes
[335814@oracleclient ~]$ cat list[^23]
this s list 1
hi
hello
where are you
[335814@oracleclient ~]$ cat >list1
this s list 1
hi
hello
where are you
[335814@oracleclient ~]$ cat >list2
this is list 2
apple
orange
grapes
[335814@oracleclient ~]$ cat >list3
this is list 3
potato
beans
peas
[335814@oracleclient ~]$ cat list[^12]
this is list 3
potato
beans
peas
[335814@oracleclient ~]$ cat list[^13]
this is list 2
apple
orange
grapes
[335814@oracleclient ~]$ cat list[^23]
this s list 1
hi
hello
where are you
jeeva- Posts : 50
Points : 93
Join date : 2010-03-04
Re: dbt in syntax
hey i got somethin...
for the same above lists
[335814@oracleclient ~]$ cat list["^23"]
this is list 2
apple
orange
grapes
this is list 3
potato
beans
peas
for the same above lists
[335814@oracleclient ~]$ cat list["^23"]
this is list 2
apple
orange
grapes
this is list 3
potato
beans
peas
jeeva- Posts : 50
Points : 93
Join date : 2010-03-04
Re: dbt in syntax
ya i agree with jeeva.....
list[^12]
here ^ does the work of negation....prints all files named list(followed by single alphabet or number like list0 or listA) except list 1 and list2
while list["^12"]
displays contents of the file list1 and list2
list[^12]
here ^ does the work of negation....prints all files named list(followed by single alphabet or number like list0 or listA) except list 1 and list2
while list["^12"]
displays contents of the file list1 and list2
Last edited by akalya on Thu Mar 11, 2010 6:10 pm; edited 1 time in total
akalya- Posts : 70
Points : 86
Join date : 2010-03-04
Re: dbt in syntax
sorry. i didn't read the question properly. if u give list[^12], it means tat "list+(any one character other than 1 and 2)"
Re: dbt in syntax
ya akalya i think that negation is not necessary inside " "... i tried
jeeva- Posts : 50
Points : 93
Join date : 2010-03-04
Re: dbt in syntax
@christopher and @jeeva
yup...u ppl are rite...
yup...u ppl are rite...
akalya- Posts : 70
Points : 86
Join date : 2010-03-04
Re: dbt in syntax
consider i have the files list1,list2 and list12 .....how i display the contents of al these files appended
akalya- Posts : 70
Points : 86
Join date : 2010-03-04
Re: dbt in syntax
Display it where ? On the console ?
Won't cat list1 list2 list12 do that ?
Won't cat list1 list2 list12 do that ?
Maithreyi- Posts : 76
Points : 142
Join date : 2010-03-03
Age : 36
Location : Haldia
Re: dbt in syntax
cat list1 list2 ---->cat list[12]
i was trying to find similar equivalent one for cat list1 list2 list12....
this works
cat list[12][2]--->list12 and list22
cat list[12][21]---->list12,list21,list11,list22
i was trying to find similar equivalent one for cat list1 list2 list12....
this works
cat list[12][2]--->list12 and list22
cat list[12][21]---->list12,list21,list11,list22
akalya- Posts : 70
Points : 86
Join date : 2010-03-04
Re: dbt in syntax
but in this case list1 and list2 are not comin na...!!
jeeva- Posts : 50
Points : 93
Join date : 2010-03-04
Re: dbt in syntax
this is a easy way to do this.
this displays list1, list2, list11, list12, list21, list22.
i guess u want to do this by passing single argument.
- Code:
$ cat list[12] list[12][12]
this displays list1, list2, list11, list12, list21, list22.
i guess u want to do this by passing single argument.
Re: dbt in syntax
yup...
something like list[12] should return files list1,list2,list12,list21
something like list[12] should return files list1,list2,list12,list21
akalya- Posts : 70
Points : 86
Join date : 2010-03-04
Page 1 of 2 • 1, 2
Similar topics
» [SYNTAX] sed command
» [SYNTAX] tr command
» [SYNTAX] grep command
» [ SYNTAX ] Control Structures in Shell
» [SYNTAX] Working with Directories and Files
» [SYNTAX] tr command
» [SYNTAX] grep command
» [ SYNTAX ] Control Structures in Shell
» [SYNTAX] Working with Directories and Files
Permissions in this forum:
You cannot reply to topics in this forum
|
|