10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have some tab delimited text data,
file: final_temp1
aname val
NAME;r'(1,) 3.28584
r'(2,)<tab>
NAME;r'(3,) 6.13003
NAME;r'(4,) 4.18037
r'(5,)<tab>
You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Discussion started by: LMHmedchem
2 Replies
2. Shell Programming and Scripting
Hello,
I'm new here. I test these expressions's value in my script :
(in centOS 6 )
#!/bin/bash
array='something'
echo "############"
echo ${array}
echo ${array}
echo ${array}
echo "############"
The output result is :
#################
something
something
#################... (5 Replies)
Discussion started by: lingjing
5 Replies
3. Shell Programming and Scripting
Hi all
I have a problem where i have a large list ( up to 1000 of items) and need to have 2 items pulled from it into variables in a bash script
my list is like the following and I could have it as an array or possibly an external text file maintained separately. Every line is different and... (6 Replies)
Discussion started by: kcpoole
6 Replies
4. 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
5. 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
6. 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
7. Shell Programming and Scripting
practicing perl now and hope to get uniq item from an array:
my current work:
#!/usr/local/bin/perl
my @source = ("aaa", "aaa", "bbb", "ccc", "ddd");
my $index=0;
my @uniq;
foreach (@source)
{
chomp;
# push first item to @uniq
if ($index == 0)
{
push @uniq, $_;
... (2 Replies)
Discussion started by: tiger2000
2 Replies
8. 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
9. 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
10. Shell Programming and Scripting
hi,
I get a *.dat files list in an array using:
array=($(find . -name "*.dat"))
the problem is that when a filename contains spaces, each space-separated token of the filename is in a different element of array.
For instance if I have:
x@x:~/tmp$ ls *.dat
test1.dat test 2.dat ... (1 Reply)
Discussion started by: jul
1 Replies