M
MM
Hello,
Does anyone know a nice way to create an array with names of the files in a
path? That is, each element in the array is a name (just the name!) of one
of the files in the path.
A short example.
The path have these files:
-rw-r--r-- 1 john john 111 Sep 10 12:52 e_out2.log
-rw-r--r-- 1 john john 125 Sep 10 12:52 e_out.log
-rw-r--r-- 1 john john 182 Sep 10 12:52 p_out2.log
-rw-r--r-- 1 john john 210 Sep 10 12:52 p_out.log
-rw-r--r-- 1 john john 1050679 Sep 10 12:52 test2.prn
-rw-r--r-- 1 john john 1050679 Sep 10 12:52 test2.ps
-rw-r--r-- 1 john john 1050795 Sep 10 12:52 test.prn
-rw-r--r-- 1 john john 5426813 Sep 10 12:52 test.ps
Then I want the array, say $Files, to be like this:
$Files[0] = e_out2.log
$Files[1] = e_out.log
$Files[2] = p_out2.log
$Files[3] = p_out.log
$Files[4] = test2.prn
$Files[5] = test2.ps
$Files[6] = test.prn
$Files[7] = test.ps
Many thanks in advance,
MM
Does anyone know a nice way to create an array with names of the files in a
path? That is, each element in the array is a name (just the name!) of one
of the files in the path.
A short example.
The path have these files:
-rw-r--r-- 1 john john 111 Sep 10 12:52 e_out2.log
-rw-r--r-- 1 john john 125 Sep 10 12:52 e_out.log
-rw-r--r-- 1 john john 182 Sep 10 12:52 p_out2.log
-rw-r--r-- 1 john john 210 Sep 10 12:52 p_out.log
-rw-r--r-- 1 john john 1050679 Sep 10 12:52 test2.prn
-rw-r--r-- 1 john john 1050679 Sep 10 12:52 test2.ps
-rw-r--r-- 1 john john 1050795 Sep 10 12:52 test.prn
-rw-r--r-- 1 john john 5426813 Sep 10 12:52 test.ps
Then I want the array, say $Files, to be like this:
$Files[0] = e_out2.log
$Files[1] = e_out.log
$Files[2] = p_out2.log
$Files[3] = p_out.log
$Files[4] = test2.prn
$Files[5] = test2.ps
$Files[6] = test.prn
$Files[7] = test.ps
Many thanks in advance,
MM