That would allow for invalid dates, e.g., filename009900.dat. In ksh, give this a try (slightly tested):
Keep in mind that you still would be allowing for non-existent dates such as February 31 or November 31.
I would like to process a list of files matching: GPS*\.xyz with an awk script. I would then like to output the files to GPS*\.xyz.out (e.g. the same file name appended with .out). Something like:
awk '{if(NR==1) {offset=-$1}; $1=$1+offset; print }' GPS*.xyz
this does exactly what I want EXCEPT... (3 Replies)
How can I pass in an argument such as "*.k" to a bash script
without having to double-quote *.k and not having *.k
`glob` to match all files in the pattern?
I tried using noglob in my script but this didn't work the way I thought
it would.. expansion is still occuring, $# is higher than I... (3 Replies)
Hi,
I have a path like this c:\test\sample\programs, i need to change thiis to c:\\test\\sample\\programs. How to perform this? I tried tr command but it didn't help me.
Thanks
Vijayan (3 Replies)
Hi all,
I need to know way of inserting backward slash before forward slash. My problem is that i need to supply directory path as an argument while invoking cshell script. This argument is further used in script (i.e. sed is used to insert this path in some file). So i need to place \ in front... (2 Replies)
Hi guys,
Here is a simple script. It writes the current time to specific files in a directory.
The arguments are the names of the files to write the date to (without path nor extension).
root:~# cat /usr/local/bin/dummy.sh
#!/bin/sh -e
for file in $@; do
date >> /var/lib/$file.dat... (11 Replies)
hi guys,
jus some file globbing questions
sed "s/^.*on//"
what does the full stop and asterisk means?
i onli know that ^ means inverse or not (1 Reply)
Hello folks!
While "sedding" about again, I ran into this little conundrum du jour:#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
@ARGV = ('./afile.dat', './*.txt');
$^I = '';
while (<>)
{
s/Twinkies/Dinner/g;
print;
}When run, perl complains,...but, of... (1 Reply)
Hello folks!
While "sedding" about again, I ran into this little conundrum du jour:#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
@ARGV = ('./afile.dat', './*.txt');
$^I = '';
while (<>)
{
s/Twinkies/Dinner/g;
print;
}When run, perl complains,...but, of... (2 Replies)
Hi ,
I'm facing a different behaviour with one of my shell script for last few days. It was working good before that.
here is my code for the script FileRemove.sh
#get the file name#
file1=$1
file2=$2
rm $file1 # delete the old file
mv $file2 <target path> #move the new file to the target... (5 Replies)