Sponsored Content
Top Forums Shell Programming and Scripting Simple While read causing issues Post 302464518 by tostay2003 on Wednesday 20th of October 2010 10:51:08 AM
Old 10-20-2010
Simple While read causing issues

Hi,

I have a simple while loop (ksh scripting).

Code:
while read ln1
do
   echo $ln1
done < $LogDir/$LogFile

the echo statement is displaying log file contents + also the files in $LogDir. I am not sure how it is displaying the files under $LogDir. There is no ls command either in $LogFile

Moderator's Comments:
Mod Comment Use code tags, thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simple Bash Read File question

Hello all, I am trying to write a simple script that will parse through a text/properties file and check a couple of if statements. Here is what I have so far: FILENAME=$1 while read line do echo $line done < $FILENAME When I call ./simple.sh testfile.txt I recieve a file or... (7 Replies)
Discussion started by: lamagra
7 Replies

2. UNIX for Dummies Questions & Answers

help with simple read script!

Hi y'all...I've been wracking my brain over this very simple script that reads in a textfile and echos each line. But I keep getting an error. Below is my script: #!/bin/bash while read myline do echo $myline done < t_file-20080221.01.asc The error I am getting is: syntax error... (1 Reply)
Discussion started by: kevlar28
1 Replies

3. Shell Programming and Scripting

Nohup causing issues

Hi folks... I really need some help soon with this issue I am having when I run my script using 'nohup'. Below is a function 'checkReturn' that my script uses to check whether other functions or tasks errored out with a non-zero exit code. function checkReturn { if ; then ... (2 Replies)
Discussion started by: ChicagoBlues
2 Replies

4. Shell Programming and Scripting

Read/Search file being written to giving error due to timing issues

The following is a piece of code to rename LOG_FILE_NEW to LOG_FILE once you get a result (either RUNNING or SHUTDOWN) RESULT="" sleep 30 while ; do sleep 10 RESULT=`sed -n '/RUNNING/'p ${LOG_FILE_NEW}` if ; then RESULT=`sed -n '/SHUTTING_DOWN/'p ${LOG_FILE_NEW}` fi done mv... (3 Replies)
Discussion started by: sonorous
3 Replies

5. UNIX for Dummies Questions & Answers

simple way to read an array in ksh

hi, I'm a newbie to shell scripting. I wanted to initialise an array using basic for loop and read it. Then i want to print it as a .CSV file.. Any help would me much appreciated.. (1 Reply)
Discussion started by: pravsripad
1 Replies

6. Shell Programming and Scripting

Issues using array credentials to read contents of a file

Hi, I am trying to read the contents of a file using array credentials in unix. The file I am trying to read is tab separated and contains the below contents. # partnerid Direc Server Port Source_Dir Target_Dir Mask Remove Files Passwordless Compare Files ... (3 Replies)
Discussion started by: aartikara
3 Replies

7. Shell Programming and Scripting

Simple while read line loop question

#!/bin/bash count=1 while read line do if (($count > 4)); then awk -v var1="$count" '{printf "%3s%8s%11s%11s%11s\n",var1,$2,$3,$4,$5}' else echo $line fi count=$((count+1)) done < posre_sub.itp > test cat test INPUT: ; position restraints for... (3 Replies)
Discussion started by: origamisven
3 Replies

8. Homework & Coursework Questions

Shell Script to read a tab delimited file and perform simple tasks

1. The problem statement, all variables and given/known data: Hello! I need help with this problem bash shell scripting that basically just reads the data in a tab delimited file and does the following below 1. Read in the data file Survey.txt and assign the column values to variables of... (6 Replies)
Discussion started by: jsmith6932
6 Replies

9. Proxy Server

Samba on AIX, issues setting read-only flag on files?

Hello, I am having issues setting the "read-only" flag via Windows Explorer on my AIX Samba share... I have on my AIX 7.1 system installed Samba 3.6.24 and configured, joined to our Windows domain successfully. The samba binaries I got from perzl.org/aix In my smb.conf I have... ... (1 Reply)
Discussion started by: c3rb3rus
1 Replies

10. Shell Programming and Scripting

Simple script to test mountGpoint for read-write

Guys, need your help urgently. ServerA ServerB ServerA has an email facility and can connect remotely via root using key to ServerB What I am trying to achieve here is ServerA would be able to remotely: 1. Do command 'touch /mnt/testfile.date' on ServerB 2. If touch failed with... (4 Replies)
Discussion started by: jaapar
4 Replies
ksysguarddrc(5) 						File Formats Manual						   ksysguarddrc(5)

NAME
ksysguarddrc - ksysguardd configuration DESCRIPTION
ksysguardd uses a configuration file at /etc/ksysguarddrc. PARAMETERS
There are 2 sections of configuration in the ksysguardd configuration file: LogFiles, Sensors. [LogFiles] OPTIONS the list of all available logfiles messages:/var/log/messages,kern:/var/log/kern.log,daemon:/var/log/daemon.log,syslog:/var/log/syslog,auth:/var/log/auth.log [Sensors] OPTIONS Sensors: the list of all accessible sensors Apm Advanced Power Management Acpi Advanced Configuration and Power Interface CpuInfo CPU-Clock information DiskStat partition space. Data comes from mtab, getmntent() and statfs() DiskStats disk throughput. Data comes from /etc/diskstats LmSensors information about motherboard and CPU LoadAvg system load values LogFile local logfiles Memory physical memory and swap NetDev throughput of network interfaces NetStat number of TCP/UDP/ICMP/Unix sockets ProcessList current processes SoftRaid Monitors software raid devices. See mdadm. Stat interrupts, CPU and disk throughput. Data comes from /etc/stat Uptime System uptime. Data comes from /etc/uptime Sensors=ProcessList,Memory,Stat,NetDev,NetStat,Apm,Acpi,CpuInfo,LoadAvg,LmSensors,DiskStat,LogFile,DiskStats,Uptime,SoftRaid FILES
/etc/ksysguarddrc ksysguardd configuration file ksysguardd ksysguarddrc(5)
All times are GMT -4. The time now is 02:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy