All Questions
Tagged with bash-array linux
5 questions
0
votes
0
answers
31
views
How to find the user input time lies between which two time frame stored in array in bash script [duplicate]
let the given array is array=(12:45 01:30 02:02 02:55 03:55)
so how to find the time let, 12:50 is lie between which two time frame(with index) is bash script
array=(12:45 01:30 02:02 02:55 03:55)
...
0
votes
2
answers
178
views
grep results with spaces and special chars
I am trying to grab results from lshw and add them to a a bash array so I can create a new string. I am using
lshw -class disk |egrep -A 7 .'-d' |grep 'product' |cut -b 17-
the output looks like this
...
0
votes
1
answer
349
views
Expanding a variable inside quotes
I am trying to get the files from S3 bucket,starting with certain prefix. To do so am using aws cli command in the bash script.
Below is my code
#!/bin/bash
FILESIZE=$(mktemp)
declare -a files=( "...
1
vote
0
answers
289
views
Assigning array values while running a loop to a variable dynamically
The values present in indexArray are: 1 4 3 2
Below is the code snippet(This is not the complete code):
while read -r line;do
position=${indexArray[$counter]} # No value is assigned to "position" ...
1
vote
1
answer
6k
views
linux + how to convert variable to array
we want to set variable that includes words as array
folder_mount_point_list="sdb sdc sdd sde sdf sdg"
ARRAY=( $folder_mount_point_list )
but when we want to print the first array value we get all ...