so this is what i want to do. i have data that looks like this:
DATA:
The actual data is of course much bigger than this. But the above is the layout. What i want to do is grab certain values under each Array.
So for Array B, say i want to grab the value of "Sectors Per Track", how do i do so? in this case, i'd like an output similar to: ArrayB=(Sectors Per Track,32).
My first instinct is to run a while loop on the command that produces the data. but i'm not sure of how to make the while loop smart enough to know when each Array begins and when it ends.
I'm hoping awk can be used here.
The ultimate goal here is to be able to grep for certain things under each array and be able to tie thing being grepped for back to the array, as i bolded above.
Another example, for Array A, see if there are any strings that contain the word "Fail". If there are, output the lines. ex. ArrayA=(physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 300 GB, Failed)
I have a table in oracle which has 2 columns
table_name table_name1
U1 T1
U2 T2
I have to take these as a variable in unix and then go to /home/bin and execute a unix command using these variables.
Considering that there is only one row in the table I was able to write the below but need help... (2 Replies)
Hello,
I've written a script to automate encoding of all the MP4 files in a directory (incl. subdirectories). But unfortunately it's running for the first MP4 file only.
My machine details:
root@Ubuntu16:~# uname -a
Linux Ubuntu16 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48... (2 Replies)
Hi All,
I have a file like this(having 2 column).
Column 1: like a,b,c....
Column 2: having numbers.
I want to segregate those numbers based on column 1.
Example:
file.
a 5
b 9
b 620
a 710
b 230
a 330
b 1910 (4 Replies)
I need to graph data that's in a file. however, i only know of a way to graph data as it comes (meaning, as it is spat out by whatever process or job). i dont know how to graph data in a file.
im using rrdtool to graph data. and i was wondering if anyone know of a way to pass a file (the... (3 Replies)
echo "The recreate was successfully completed for device file $LCL_CLN_FILE." >> $LOG_FILE
remaining=$(symclone -sid $LCL_SID -f $ETC/$LCL_CLN_FILE query | grep MB | awk '{print $2}')
if
then
while
do
echo "$remaining MB's to be copied........." >> $LOG_FILE
... (10 Replies)
Hi
I have a file called lastlogin_1 that contains a list of usernames. I would like to put together a quick loop script that will use a variable (the contents of lastlogin_1 file) and grep all directories and sub directories in the current directory (/in/the/current/directory) for each username... (3 Replies)
HI.
I am trying to run 2 commands, using the "for x in a b c d" loop but i am having a hard time coding it...
Here is what i have so far:
for SERVER in SERVERA SERVERB SERVERC SERVERD SERVERE
do
###############################################################################
#... (5 Replies)
Hi Gurus,
Could you please help me to create a shell script that will be started by a cron job once every night at 24.00 h (that should bee easy:))
The shell script should control every 30 seconds the name of a process, and when the process doesn't run anymore it should execute a few further... (12 Replies)
I have a script that users a while read, whithin this I want to execute the cp -i command on some of the results, however because it is in a loop it skips the -i part of cp. How do I get the loop to stop each time cp -i is run and wait for the user to type the response. (2 Replies)
Hi All,
I am having trouble through, I am reading the input from tab delimited file containing several records,
e.g.
line1 field1 field2 field3 so on..
line2 field1 field2 field3 so on..
..
..
on the basis of certain fields for each record in input file, I have to retrieve... (1 Reply)