10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Does anyone know how to find length of multi dimension array
of following type
A Afor simple array I is to do
for (i in A)n++ to find length of array but if it is multi dimension how to find the length ? (2 Replies)
Discussion started by: nex_asp
2 Replies
2. Shell Programming and Scripting
I need help parsing the output of find into an array. I need to search 3 directories and find all files older than 31 days old. This is what I have so far.
TIME=" -maxdepth 1 -mtime +31"
DIR1="/dir1/"
DIR2="/dir2/"
DIR3="/dir3/"
FIND_DIR1=$(find ${DIR1}${TIME})
FIND_DIR3=$(find... (8 Replies)
Discussion started by: jrymer
8 Replies
3. Shell Programming and Scripting
Hi
I'm trying to write a shell script which finds all the .zip files in a given directory then lists them on the screen and prompts the user to select one by entering a number e.g.
The available files are:
1. HaveANiceDay.zip
2. LinuxHelp.zip
3. Arrays.zip
Please enter the... (4 Replies)
Discussion started by: zX TheRipper Xz
4 Replies
4. Shell Programming and Scripting
set -A allfiles `find $usrhtml -type f`
i am trying to populate this array with the find command. It works fine when find is looking through a single directory but when i add a new subdirectory the files in the subdirectory get duplicated. Can anyone help me and fix this so each files in... (1 Reply)
Discussion started by: bjhum33
1 Replies
5. Shell Programming and Scripting
Hi
I am really new to awk and using shell script but I am wondering if its possible to find the sum of an array? I looked online but most of the things there are confusing, and when I tried it on my own it kept giving me the value of the last entry into the array for the sum.
I have an array... (2 Replies)
Discussion started by: razrnaga
2 Replies
6. Shell Programming and Scripting
I'm trying to add the paths of all the xml files in certain directories to an array. I want to use the array later in my code. Anyway, for some reason this isn't working. Any help would be appreciated.
Path_Counter=0
for result in "find * -name '*.xml'"; do
XmlPath="$result"
echo... (2 Replies)
Discussion started by: Fly_Moe
2 Replies
7. Shell Programming and Scripting
Newbie to bash here. I think this is fairly simple, but I have searched and cannot figure it out. In the code below, I am searching an array for an IP address, and then printing the IP address if found. However, I would like to print the actual variable found such as 2.2.2.2=2, but cannot figure... (1 Reply)
Discussion started by: lozwell
1 Replies
8. Shell Programming and Scripting
I am using /bin/ksh for this problem.
I have created some arrays with variable names as the array names:
cnt=1
{ while read myline; do
tempmeas="${meas%%;*}"
cto="${meas#*;}"
tempstream=$stream
# wholemeas holds the name of the array
# each array name... (0 Replies)
Discussion started by: ajgwin
0 Replies
9. Shell Programming and Scripting
Dear all,
I'm have a sorted array like this:
177
220
1001
2000
2001
2003
2005
notice that 2002 and 2004 are NOT in array.
Then user input a number INPUT, our script should return OUTPUT value like this:
if INPUT is not in array => OUTPUT=INPUT
if INPUT is in array => OUTPUT is the... (4 Replies)
Discussion started by: fongthai
4 Replies
10. Shell Programming and Scripting
Dear Experts,
please help me out once again my array concepts is not very clear i have one text file like.
1|usa|hh
2|usa|ll
3|usa|vg
4|uk|nn
5|uk|bb
6|kuwait|mm
6|kuwait|jkj
7|dubai|hh
i want to store the third fied of a text file in he array and after that it should give me some... (6 Replies)
Discussion started by: shary
6 Replies