Sponsored Content
Top Forums Shell Programming and Scripting Reading multiple directories and file from them Post 302902089 by bartus11 on Sunday 18th of May 2014 12:42:53 PM
Old 05-18-2014
Try:
Code:
DATE=`date +"%m-%d"`
cd /sys/bus/w1/devices
for sensor in 10-*; do
  cat ${sensor}/w1_slave >> /some/dir/${sensor}_${DATE}.csv
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copy single file to multiple directories

Please help - I need to copy a single file to multiple directories. Dir structure: Parent_Directoy Filename1 Child_Directory1 Child_Directory2 Child_Directory3 Child_Directory4 .... So I need to copy Filename1 to all of the... (2 Replies)
Discussion started by: kthatch
2 Replies

2. UNIX for Dummies Questions & Answers

Clean directories by reading from file

I have a file in following format directory1=/out/log purgedays1=4 extn1=log,out,txt directory2=/clean/log purgedays2=4 extn2=log,out now i need need to create a script that reads this file and cleans all the files with the given extn from the given directory. The catch here is that... (2 Replies)
Discussion started by: max_payne1234
2 Replies

3. Shell Programming and Scripting

check if multiple directories exist else create missing directories

Hi , I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory. how to write this in a simple script, I have made my code complex if ; then taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies

4. Shell Programming and Scripting

Multiple jobs reading from same file

I have a sequence of tasks that I routinely run and I'm trying to parallelize certain portions of the sequence. Specifically, there are 3 tasks which all read from the same file, each performing different operations and writing to their own seperate file. I was wondering if I could execute these... (3 Replies)
Discussion started by: erichpowell
3 Replies

5. UNIX for Dummies Questions & Answers

Deleting multiple directories inside multiple directories

Hi, Very unfamiliar with unix/linux stuff. Our admin is on vacation so, need help very quickly. I have directories (eg 40001, 40002, etc) that each have one subdirectory (01). Each subdir 01 has multiple subdirs (001, 002, 003, etc). They are same in each dir. I need to keep the top and... (7 Replies)
Discussion started by: kkouraus1
7 Replies

6. Shell Programming and Scripting

file name shortening for multiple directories

there was a post previously about this from around 2010 but i was unable to get the suggested scripts there to work. the following code works for me when it's saved inside the directory of files whose names i want to shorten, but i would like to be able to store it in a file with a list of ... (4 Replies)
Discussion started by: giseismology
4 Replies

7. UNIX for Dummies Questions & Answers

copy file using unix in multiple directories

Hi All Genious, I want to copy a file name XYZ .In a directory /HOME/dir/IXOS1/dir1 which contain multiple directories named not in pattern want to copy the XYZ in all of the directories available on path /HOME/dir/IXOS1/dir1 . Thanks in advance . (2 Replies)
Discussion started by: mumakhij
2 Replies

8. Shell Programming and Scripting

While loop reading file with multiple conditions

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

9. Shell Programming and Scripting

Help with create multiple directories under diff file systems

Hi, Need help ...I want to create multiple directories in different /file systems using for loop..eg.../ORCL_data01/oradata/orcl/ctl. ../ORCL_data01/oradata/orcl/data. ../ORCL_data01/oradata/orcl/redo. Script :- ========= for dir in `ls -d... (8 Replies)
Discussion started by: Linux6.5
8 Replies

10. Shell Programming and Scripting

Reading multiple lines in a file

Hello, I am new in shell scripting. I need help regarding following. I have 4 files generated by backups daily. I have stored the names of these 4 files into one file. i.e I have 4 files names as a, b, c & d and these names have been put into one file abcd.txt. Now I want to cat each file in... (7 Replies)
Discussion started by: Ali Sarwar
7 Replies
DIGITEMP(1)						      General Commands Manual						       DIGITEMP(1)

NAME
digitemp - program to read from temperature sensors. SYNOPSIS
digitemp [options] DESCRIPTION
DigiTemp uses the Dallas 1-wire bus to read temperatures from digital sensors attached to a serial port adapter. It handles initializing the bus, searching for attached devices, reading devices and custom log strings. It suports the following temperature devices: DS1820, DS18S20, DS18B20, DS1822 It also handles the DS2406 1-wire hub switches, and DS2422 and DS2423 counters. DigiTemp uses either the DS9097 passive serial port adapter, or the DS2480B based DS9097U adapter (recommended). OPTIONS
At least 1 action must be given, along with some optional arguments. Actions are one (and only on) of the -w -t -a -w options -h, -? Show summary of options. -v Show verbose output. -i Initialize .digitemprc file, search the bus for all supported devices. -w Walk the full device tree and display the serial number and type of all devices detected on the bus. -s /dev/ttyS0 Set serial port to use. Make sure you have permission to access this port. -l /var/log/temperature Send output to logfile, the output format is defined by the .B -o command -c digitemp.conf Set digitemp configuration file. The default is .digitemprc in the current directory. -r 1000 Read delay in ms. This sets the amount of time to wait between sending the temperature conversion command and reading the result. The DS18S20 takes about 750mS to do the temperature conversion. Default is 1000mS (1 sec). -t # Read sensor number #, the # depends on the order of the sensors in the .digitemprc file. -q Quiet output, no copyright banner. -a Read all sensors. -A Treat DS2438 as A/D converter, output raw voltages -d 5 Delay between samples (in seconds). -n 50 Number of times to repeat the command. -O"counter format string" See Counter Format below. -o [1..3] ["output format string"] See Temperature Format below. -H"Humidity format string" See Humidity Format below. Temperature Format The temperature format can be either a numeric value, or a string. The numeric values select pre-configured output formats: 1 = One line per sensor, time, C, F (default) 2 = One line per sample, elapsed time, temperature in C 3 = Same as #2, except temperature is in F #2 and #3 have the data separated by tabs, suitable for import into a spreadsheet or other graphing software. The format string uses strftime tokens plus 5 special ones for DigiTemp: %s for sensor # %C for centigrade %F for fahrenheit %R to output the hex serial number %N for seconds since Epoch. The case of the token is important! The default format string is: "%b %d %H:%M:%S Sensor %s C: %.2C F: %.2F" which gives you an output of: May 24 21:25:43 Sensor 0 C: 23.66 F: 74.59 The DS2438 sensor can be used for a variety of things. It includes a temperature sensor and A/D converter. DigiTemp defaults to using it as a humidity sensor. The raw voltages can be displayed by passing the -A argument When the -o2 or -o3 log options are used the attached DS2438's temperatures will be output without the humidity. Counter Format String The counter format string is similar, adding these tokens: %n is the counter #, which depends on its position in the .digitemprc file %C is the count in decimal. Humidity Format String The Humidity format string is the same as the temperature format string with the addition of this format specifier: %h is the humidity in 0-100% AUTHOR
This manual page was written by Jesus Roncero <jesus@roncero.org>, for the Debian project (but may be used by others). Modifications by Brian C. Lane <bcl@brianlane.com> UPDATES
DigiTemp updates can be found on the http://www.digitemp.com website. June 2005 DIGITEMP(1)
All times are GMT -4. The time now is 07:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy