10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
In the else of the main if condition .
else
set lnk = $(readlink -f <path> | cut -d '/' -f7)
echo "$lnk"
if ]
When I run the above on command line , the execution seems to be fine and I get the desired output. But when I try to assign it to a variable within a loop... (12 Replies)
Discussion started by: sankasu
12 Replies
2. UNIX for Advanced & Expert Users
I have a below syntax its working fine...
var12=$(ps -ef | grep apache | awk '{print $2,$4}')
Im getting expected output as below:
printf "%b\n" "${VAR12}"
dell 123
dell 456
dell 457
Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
3. Shell Programming and Scripting
Hi,
This is my input file
cat input
chr1:100-200
chr1:220-300
chr1:300-400
Now, I would like to run a program that will take each of the input record
for i in `cat input`; do program $i | wc -l;done
the output will be something like
10
20
30
But, I would like to print the... (4 Replies)
Discussion started by: jacobs.smith
4 Replies
4. Shell Programming and Scripting
Hi All,
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am trying to get a loop counter i and set its value as the ouput of a command:
i=`printmo TEST1 | grep -i TEST2 | wc -l`
Then I want to use i as counter to run a loop i number of times.
Like if i gets a value of 5 I'll have to run loop 5 times.
But will i here be a numeric... (3 Replies)
Discussion started by: pat_pramod
3 Replies
6. Shell Programming and Scripting
Hello All,
Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....?
I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping
through a string containing some of these "Illegal Characters". Now... (5 Replies)
Discussion started by: mrm5102
5 Replies
7. UNIX for Dummies Questions & Answers
Hello guys,
This truly is a newbie question. I'm trying to make a loop to execute simultaneous commands indefinitely while using variable. Here is how my mess looks like (this is just an example):
#!/bin/bash
IP=`shuf -n 1 IP.txt` # I figured this would be easier to select random lines... (4 Replies)
Discussion started by: bobylapointe
4 Replies
8. Shell Programming and Scripting
I have a group of variables myLINEcnt1 - myLINEcnt10. I'm trying to printout the values using a for loop. I am at the head banging stage since i'm sure it has to be a basic syntax issue that i can't figure out.
For myIPgrp in 1 2 3 4 5 6 7 8 9 10; do
here i want to output the value of... (4 Replies)
Discussion started by: oly_r
4 Replies
9. Shell Programming and Scripting
Simple enough problem I think, I just can't seem to get it right.
The below doesn't work as intended, it's just a function defined in a much larger script:
CheckValues() {
for field in \
Group_ID \
Group_Title \
Rule_ID \
Rule_Severity \
... (2 Replies)
Discussion started by: Vryali
2 Replies
10. Shell Programming and Scripting
Hi all
I run my program prog.c in the following way :
$ ./prog 1 > output.txt where 1 is a user defined initial value used by the program.
But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
Like
$ ./prog 1... (1 Reply)
Discussion started by: alice06
1 Replies