10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
I have a text file named "foreach.txt" which reads like ---
foreach cal ( 1 2 3 4 5 )
I am using a simple script which looks like ---
#!/bin/tcsh
foreach cal (1 2 3 4 5)
echo "$cal"
end
Is it possible to modify the script in such a way that instead of writing
foreach cal (1... (6 Replies)
Discussion started by: Indra2011
6 Replies
2. Shell Programming and Scripting
I need to know how the the string constant from Input File should be read and provide as input data for the script .
INPUT FILE
CONST VARIABLE
myname=/root/dir/syslog/myname1
myname=/root/dir/syslog/myname2
myname=/root/dir/syslog/myname3
urname=/root/dir/syslog/urname1... (6 Replies)
Discussion started by: baraghun
6 Replies
3. Shell Programming and Scripting
Hi folks,
I'm using bash and would like to do the following. I would like to read some values from the file and store it in the variable and use it.
My file is 1.txt and its contents are
VERSION=5.6
UPDATE=4
I would like to read "5.6" and "4" and store it in a variable in shell... (6 Replies)
Discussion started by: scriptfriend
6 Replies
4. Shell Programming and Scripting
HI all,
I have a parameter file with entries like
$$Name =Abhinav
$$CUTOFF_DATE = 11/11/2209
I am reading a variable from this file using a awk command like :
var2=`awk -F"" "/CUTOFF_DATE/{f=$1;}{print f;}" InputFIleName`
but facing an error like
awk: cmd. line:1:... (3 Replies)
Discussion started by: abhinav192
3 Replies
5. Shell Programming and Scripting
Hello,
I need to read a variable value from script.
Below is the scenario
I am reading a value from an external file say a.txt
a.txt:
Jan
Feb
Mar
I need the corresponding value of the months in in numerics such as Jan -->1,
Feb-->2 etc.
I have this mapping in another file... (1 Reply)
Discussion started by: aixjadoo
1 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have a situation where I need to read a variable from another file. But the problem is that the variable in the other file is starting with $.
E.g.
file1:
$var1=out
temp_ss.sh:
. file1
echo "Print : $var1"
It works fine if the file1 is having var1=out (note that it is... (6 Replies)
Discussion started by: shash
6 Replies
7. Shell Programming and Scripting
Hi,
I am doing :
while read line
do
printf "%s\n" ${line}
done <datafile.txt
but I am not getting each single line from the data file assigned to the variable line (but only tokens/fields at a time). I also tried while IFS= read -r lineI want the whole line assigned or read into the... (2 Replies)
Discussion started by: shri_nath
2 Replies
8. Shell Programming and Scripting
Hi,
Here is the output of lpstat. I would like to read value of Queue which is(abxxxxb1)and status that is DOWN in first line. i dont care what is in second line. any one can help me.thanks
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- ---------... (5 Replies)
Discussion started by: sagii
5 Replies
9. Shell Programming and Scripting
hi,
I'm using HP unix tru64 & Win XP.
i'm download a file from winxp to unix using ftp.
how to know whether a remote file is currently being used by the process or not? (my loaction unix server) (7 Replies)
Discussion started by: Tlg13team
7 Replies
10. Shell Programming and Scripting
I am missing something here, I have a file which contains only one line and that is either a number or character string. I am trying to read the file and assign that value to a variable and here it seems I am missing something and not getting the expected results... Here is the code :
#!/bin/ksh... (2 Replies)
Discussion started by: Vaddadi
2 Replies