Search Results

Search: Posts Made By: twinion
1,458
Posted By Don Cragun
Shell variables are not expanded when they appear...
Shell variables are not expanded when they appear in a string quoted by single-quotes. Since there are no spaces in the output from that date command, you could just use:
Sausage1=`date '+%Y%m%d'`...
1,548
Posted By bakunin
Just an afterthought: if i have gotten correctly...
Just an afterthought: if i have gotten correctly what you want to do is 1) wait until a file is there and 2), if it is there wait until "TRL" appears in it.

Such things should be best put into a...
1,548
Posted By RudiC
Are you sure it's just sitting there? Are you...
Are you sure it's just sitting there? Are you sure it "worked perfectly"? There's at least a do ... done missing for the second while.

Different approach for waiting "for a file to appear": while...
1,548
Posted By Don Cragun
And even if grep of a directory made sense, the...
And even if grep of a directory made sense, the commands at the end of the pipeline:
grep -c filename.$DATE.TXT | grep TRL | wc -l
will always return 0; never 1. The grep -c output will always be...
1,548
Posted By Peasant
Other then mentioned, use #!/bin/bash -x and...
Other then mentioned, use #!/bin/bash -x and examine the nohup.out during the hang.

If you are on linux system, inotify should provide much better interface for actions on file changes.
...
1,848
Posted By clx
You didn't reply to jim's first question. "Is the...
You didn't reply to jim's first question. "Is the file being generated byyour account - i.e., the process runs under your username.?"

If yes, you need to use the correct way of implementation....
1,848
Posted By rbatte1
The easiest way to know that a file is complete...
The easiest way to know that a file is complete is to also write a marker file, so if you are sending it with ftp or similar, you would do the following on the sending:-cd $target_dir
put $file
put...
1,848
Posted By achenle
First you need to precisely define "done". Then...
First you need to precisely define "done". Then how do you handle error conditions?

And you need to take into account the only entity that knows for certain that the file is "done" - and correct...
1,848
Posted By jim mcnamara
Is the file being generated byyour account -...
Is the file being generated byyour account - i.e., the process runs under your username.
If this is Linux, you can use the /proc filesystem to see if there exists a file descriptor open for that...
1,231
Posted By MadeInGermany
Some optimizations checktime=`ls -l...
Some optimizations
checktime=`ls -l /tmp/TRIGGER | awk '{ print $8 }' | sed 's/://'`
or if you check very often
checktime=`date +%H%M`
Schedule the command for 01:00
echo "Bstats1.sh 1" | at...
1,231
Posted By RudiC
What system do you use? Does it have the stat...
What system do you use? Does it have the stat command (or similar) providing file statistical info?
Why do you break the while loop instead of using the -f test's result?
Do you REALLY need to...
1,632
Posted By Lucas_0418
I'm sorry to hear that, the 'find' in your OS...
I'm sorry to hear that, the 'find' in your OS must frustrated you..

Are you able to touch some file in the directory that you are monitoring ?
If so, you could run your script via cron every...
1,278
Posted By balajesuri
#! /bin/bash f="Thisfile.20130521.txt" ...
#! /bin/bash

f="Thisfile.20130521.txt"

dt=`echo $f | cut -d'.' -f2`
day=`date -d $dt +%a`

if [[ "$day" == "Wed" || "$day" == "Thu" || "$day" == "Fri" ]]
then
fut_dt=$(( $dt + 5 ))...
2,714
Posted By hanson44
I think my idea probably fits. I think something...
I think my idea probably fits. I think something like this will likely work in a shell script:

today=`TZ=CST+24 date '+%d%m%y' --date=today`
yesterday=`TZ=CST+24 date '+%d%m%y'...
2,714
Posted By hanson44
Just playing around, as least on my linux...
Just playing around, as least on my linux computer, is this what you're looking for?
$ TZ=CST+24 date '+%d%m%y' --date=today
020413
$ TZ=CST+24 date '+%d%m%y' --date=yesterday
010413
22,658
Posted By vgersh99
assuming the your width is 79: cal | sed -e...
assuming the your width is 79:

cal | sed -e :a -e 's/^.\{1,77\}$/ & /;ta'


Courtesy of sed1liners (http://www.pement.org/sed/sed1line.txt)
Showing results 1 to 16 of 16

 
All times are GMT -4. The time now is 03:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy