Usulsuspct
04-27-2001, 01:21 PM
I am working on a homework problem for a class of mine, and I am having a little trouble. We are working in the Csh, and have to write a sript that will take two arguements (directory names) and then create a sorted list of the contents of the directory's.
I thought that I would be able to store the names of the contents in a list variable but it isnt working quite as planned. This is what I thought I would do to store the contents of one of the directories in lists then compare the two lists and create a new sorted list of the values:
set list1 = ( '/bin/ls $argv[1]' )
set list2 = ( '/bin/ls $argv[2]' )
The above commands arent working for me. I was hoping the would store in the variables a listing of the dy's contents ie.
list1 = ( a.out temp.c fruit.b )
After I the set list commands I put in a simple echo $list1 command to see if it works and I get an error saying echo: no match
What do you guys thinkg? Is it possible to create a list in that manner? And if not, how would I go about doing this?
I thought that I would be able to store the names of the contents in a list variable but it isnt working quite as planned. This is what I thought I would do to store the contents of one of the directories in lists then compare the two lists and create a new sorted list of the values:
set list1 = ( '/bin/ls $argv[1]' )
set list2 = ( '/bin/ls $argv[2]' )
The above commands arent working for me. I was hoping the would store in the variables a listing of the dy's contents ie.
list1 = ( a.out temp.c fruit.b )
After I the set list commands I put in a simple echo $list1 command to see if it works and I get an error saying echo: no match
What do you guys thinkg? Is it possible to create a list in that manner? And if not, how would I go about doing this?