10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Normally, I would do
cat /etc/oratab | grep -v "^#" | grep -v "^*" > /tmp/oratab.00
while read line
do
echo $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:
#!/bin/ksh
... (6 Replies)
Discussion started by: newbie_01
6 Replies
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
do
cat $Date |
while read line
do $SCRIPTEXE <line from first file> $2 <line from 2nd file>
... (12 Replies)
Discussion started by: khestoi
12 Replies
3. Shell Programming and Scripting
Hi.
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
2 Replies
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
2 Replies
5. UNIX for Advanced & Expert Users
Hi All,
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,
<mxc_tl_load_extractdata_prop.bsh>
DB_USER=test_oper
hostname=xxx
FTP_USER=test1_operate
MAIL_LIST=xxx@yyy.com... (1 Reply)
Discussion started by: paragd
1 Replies
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:
FILES="*"
for f in "$FILES"
do
echo -e `wc -l -w $f`
done
My issue is that my file is outputting in one... (4 Replies)
Discussion started by: jl487
4 Replies
7. Shell Programming and Scripting
Hi All,
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
9 Replies
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
11 Replies
9. Shell Programming and Scripting
STEP 1
# Set variable
FILE=/tmp/mainfile
SEARCHFILE =/tmp/searchfile
# THIS IS THE MAIN FILE.
cat /tmp/mainfile
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
6 Replies
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:
1.dhm
------
10
20
30
40
50
2.dhm
------
30
50
20 (3 Replies)
Discussion started by: dhuertas
3 Replies