10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Normally, I would do
cat /etc/oratab | grep -v "^#" | grep -v "^*" > /tmp/oratab.00
while read line
done < /tmp/oratab.00I want to know whether it is possible to use an array instead of re-directing it to file?
As a test, I did something like below:
... (6 Replies)
Discussion started by: newbie_01
2. Shell Programming and Scripting
I am trying to create a script which will read 2 files and use the lines of file 1 for each line on file 2.
here's my sample code
cat $SBox |
while read line
cat $Date |
while read line
do $SCRIPTEXE <line from first file> $2 <line from 2nd file>
... (12 Replies)
Discussion started by: khestoi
3. Shell Programming and Scripting
I'm just wondering how can I read variable text files through cat command.
I made a shell script to count frequency of words and array them with variable conditions. It's only working for one file that I wrote in script now. But I want to make it working for every text file when I execute... (2 Replies)
Discussion started by: rlaxodus
4. Shell Programming and Scripting
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Discussion started by: irudayaraj
5. UNIX for Advanced & Expert Users
I have stumbled upon very unique issue. In my script I am doing cat file and then greping and cutting so as to assign the value to variable. My file is,
MAIL_LISTemail@example.com... (1 Reply)
Discussion started by: paragd
6. UNIX for Dummies Questions & Answers
Hello, I'm trying to create a BASH file that can read all the files in my working directory and tell me how many words and lines are in that file. I wrote the following code:
for f in "$FILES"
echo -e `wc -l -w $f`
My issue is that my file is outputting in one... (4 Replies)
Discussion started by: jl487
7. Shell Programming and Scripting
Does anyone know how to read multiple lines from standard input into an array and then iterate a loop for all the lines read. Below is an example pseudocode:
I need the below filenames to be read by the script into an array or something similar:
And then in the script, I... (9 Replies)
Discussion started by: bharath.gct
8. Shell Programming and Scripting
What is wrong with my menu script? Do I need to continue with the read statements? All I want to do with option 4 is to cat some /var/log/files and awk out a few lines? How do I do that please?
$ cat menu.sh ... (11 Replies)
Discussion started by: taekwondo
9. Shell Programming and Scripting
# Set variable
# THIS IS THE MAIN FILE.
Interface Ethernet0/0 "outside", is up, line protocol is up
Hardware is i82546GB rev03, BW 100 Mbps
Full-Duplex(Full-duplex), 100 Mbps(100 Mbps)
MAC address... (6 Replies)
Discussion started by: irongeekio
10. Shell Programming and Scripting
Hi All, I really need your help. I am a begginner in shell script and I believe this is a very simple issue.
I have in my directory, n-files, like 1.dhm, 2.dhm, 3.dhm.
These files have 1 column with 1 value per line, like:
20 (3 Replies)
Discussion started by: dhuertas