10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I managed to read and print variable as shown in the below code.
table_name=table1,table2,table3
i=0
IFS=","
for i in $table_name
do
echo $i
done
Is there a way how I can read more than one variable. For example I need to read 2 variables and populate the output... (6 Replies)
Discussion started by: shash
6 Replies
2. Shell Programming and Scripting
Hello,
I would like to ask for help with csh script.
An example of an input in .txt file is below, the number of lines varies from file to file and I have 2 or 3 columns with values. I would like to read all the values (probably one by one) and set them to independent unique variables that... (7 Replies)
Discussion started by: FMMOLA
7 Replies
3. Shell Programming and Scripting
I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables.
I need to read this file which is an input to my script
Config.txt
file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies
4. Shell Programming and Scripting
Here's my code:
awk -F '' 'NR==FNR {
if (/time/ && $5>10)
A=$2" "$3":"$4":"($5-01)
else if (/time/ && $5<01)
A=$2" "$3":"$4-01":"(59-$5)
else if (/time/ && $5<=10)
A=$2" "$3":"$4":0"($5-01)
else if (/close/) {
B=0
n1=n2;
... (2 Replies)
Discussion started by: klane
2 Replies
5. Shell Programming and Scripting
Hi
Am trying to print the PIDs of process in a file and trying to grep any PID from that file
I set the if condition as $value != "PID" and $value != "-"
Assign that number to a variable
Am confused since am using while loop to read the line from file
and again if condition to check those... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
6. Shell Programming and Scripting
Hi,
I have a variable which stores file names as a result of find command. I need to delete all these files one by one, i.e. by a loop. Can anyone tell me how can it be done?
The variable f2d has the file names like these
abc.txt
bcd.txt
fff.txt
gef.txt
Now I have used a loop as... (12 Replies)
Discussion started by: jhilmil
12 Replies
7. Shell Programming and Scripting
I am using a for loop to copy files from say DIR1 and DIR2 to DIR3.I have to check whether files are copied from DIR1 and DIR2 and print the respective message.
@path=("$DIR1","$DIR2");
foreach (@path) {
$rc=system("cp $_/*xml $DIR3");
if ($rc == 0)
{
print "Files were copied... (1 Reply)
Discussion started by: liyakathali
1 Replies
8. 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
9. Shell Programming and Scripting
Hi All,
I need small help on for loop syntax in C shell.
How can we read the values from a file (line by line) through C shell loop.
For Ex:
$Cat file1
data1
data2
data3
data4
$
I have to print those values in a variable and have to perform some steps...
Can anyone help on... (2 Replies)
Discussion started by: raghu.iv85
2 Replies
10. Shell Programming and Scripting
Hello Guys,
I have a small loop problem as below.
I have 3 different values to be used while running the same script -
va1="some-value1"
va2="some-value2"
va3="some-value3"
Now I want to use these three variable values to be used for running the same command, like -
while... (1 Reply)
Discussion started by: rockf1bull
1 Replies