Sponsored Content
Top Forums Shell Programming and Scripting Shell scripting-I need a script which should watch a directory for a file with specific directory Post 302914531 by RudiC on Tuesday 26th of August 2014 12:08:51 PM
Old 08-26-2014
You could use bash's Parameter Substring Expansion:
Code:
while read line
  do COD=${line:0:4}; DOK=${line:4:16}; PRN=${line:20:20}; QTY=${line:92:15}
     echo "$COD", "$DOK", "$PRN", "$QTY"
     done < file
CSG2, FV6VFF, , 
ARD1, 96738649ES      ,                    1, 18            P

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

script to watch changes on a directory

Hi, everybody I want to know hot to watch changes on a dir, for example if someone changes a file inside it, with an script. I've tried using md5sum and then diff, sadly with no success. I use md5sum for single files, but doesn't work for directories. The idea is take a snapshot with md5sum,... (4 Replies)
Discussion started by: piltrafa
4 Replies

2. Shell Programming and Scripting

shell scripting with directory

I have a directory /ndata/nmk I want to have 4 copies of my daily database backups like /ndata/nmk/copy1 /ndata/nmk/copy2 till copy4 . where copy1-copy4 are directories having my db backups . Once my db backups reach 4 directories like copy4 i want to again write from copy1 to copy4 . ... (3 Replies)
Discussion started by: suku123
3 Replies

3. UNIX for Advanced & Expert Users

Watch directory and move specific file extensions

Hi all, This is actually more for my lazyness then anything else, but I think others might find it useful to use as well. Basically this is what I am trying to achieve... In my ubuntu home dir under Downloads is where firefox saves everything by default, now I know that you can manually... (3 Replies)
Discussion started by: STOIE
3 Replies

4. Web Development

Directory index forbidden by Options directive error on specific directory with indexing disabled

I am seeing the following error appear numerous times in my Apache error log: I have my Apache config configured as below, so I would expect indexing not to occur on this directory as it falls under the parent /web directory. Strangely all the IP address, including this example, all... (5 Replies)
Discussion started by: crmpicco
5 Replies

5. UNIX for Dummies Questions & Answers

Extract directory name from the full directory path in UNIX using shell scripting

My input is as below : /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/rebate/IFIND.REBTE.WROC.txt /splunk/scrubbed/loyal/IFIND.HELLO.WROC.txt /splunk/scrubbed/triumph/ifind.triumph.txt From the above input I want to extract the file names only . Basically I want to... (5 Replies)
Discussion started by: IshuGupta
5 Replies

6. Shell Programming and Scripting

Moving Files one directory to another directory shell script

Hi, Could you please assist how to move the gz files which are older than the 90 days from one folder to another folder ,before that it need to check the file system named "nfs" if size is less than 90 or not. If size is above 90 then it shouldn't perform file move and exit the script throwing... (4 Replies)
Discussion started by: venkat918
4 Replies

7. UNIX for Beginners Questions & Answers

How to zip csv files having specific pattern in a directory using UNIX shell script?

I have files in a Linux directory . Some of the file is listed below -rw-rw-r--. 1 roots roots 0 Dec 23 02:17 zzz_123_00000_A_1.csv -rw-rw-r--. 1 roots roots 0 Dec 23 02:18 zzz_121_00000_A_2.csv -rw-rw-r--. 1 roots roots 0 Dec 23 02:18 zzz_124_00000_A_3.csv drwxrwxr-x. 2 roots roots 6 Dec 23... (4 Replies)
Discussion started by: Balraj
4 Replies

8. Shell Programming and Scripting

Script to Tar file in a specific Directory

I'm trying to write a Unix script that will go to a specific directory (/tmp/Sanbox/logs) and tar.gz all the log files in that directory and delete the original files that are older than 2 days. So far I have this but it doesn't work. Any help would be appreciated. #!/bin/bash ... (7 Replies)
Discussion started by: Loc
7 Replies

9. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

10. Shell Programming and Scripting

Shell scripting for moving folder specific files into target directory of that country folder.

I need help to write shell script to copy files from one server to another server. Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies
Net::GPSD3::Return::Satellite(3pm)			User Contributed Perl Documentation			Net::GPSD3::Return::Satellite(3pm)

NAME
Net::GPSD3::Return::Satellite - Net::GPSD3 Return Satellite Object SYNOPSIS
use Net::GPSD3 0.13; my $gpsd = Net::GPSD3->new; my $poll = $gpsd->poll; #new method in 0.12 my $sky = $poll->sky; #new method in 0.13 printf "Reported: %s, Used: %s ", $sky->reported, $sky->used; printf "PRN: %s ", join(", ", map {$_->used ? $_->prn : "-".$_->prn} $sky->Satellites); DESCRIPTION
Provides a Perl object interface to the Satellite data structure returned by the GPSD daemon. An example JSON string: {"PRN":15,"el":77,"az":123,"ss":0, "used":false}, METHODS
class Returns the object class string Returns the JSON string parent Return the parent Net::GPSD object PRN, prn Returns the GPS Satellites Pseudo Random Number Identifier used Returns a JSON::XS::Boolean true or false object. az, azimuth Returns the azimuth, degrees from true north. el, elevation Returns the Elevation in degrees. ss Signal strength in dBHz. Note: C/N0 is dBHz usually, but trimbles can also emit poorly specified Amplitude Measurement Units. BUGS
Log on RT and Send to gpsd-dev email list SUPPORT
DavisNetworks.com supports all Perl applications including this package. Try gpsd-dev email list AUTHOR
Michael R. Davis CPAN ID: MRDVT STOP, LLC domain=>michaelrdavis,tld=>com,account=>perl http://www.stopllc.com/ COPYRIGHT
This program is free software licensed under the... The BSD License The full text of the license can be found in the LICENSE file included with this module. SEE ALSO
Net::GPSD3, Net::GPSD3::Return::Unknown perl v5.14.2 2011-11-09 Net::GPSD3::Return::Satellite(3pm)
All times are GMT -4. The time now is 09:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy