Search Results

Search: Posts Made By: yadavricky
1,817
Posted By Corona688
case "$FILENAME" in M*) echo "MYTEST...
case "$FILENAME" in
M*)
echo "MYTEST file"
;;
CMP*)
echo "CMP file"
;;
esac
1,817
Posted By protocomm
try this: if [ "$(ls file | awk -F_...
try this:

if [ "$(ls file | awk -F_ '$5~/[0-9]{8}/')" != "" ];then echo GoodFile;fi
1,817
Posted By RudiC
The file names in your first post don't follow...
The file names in your first post don't follow your spec in post#5. There's no C nor 1 in file name 1.
protocomm's proposal is fine for your sample names, but it relies on the count of the "_" as...
11,349
Posted By Chubler_XL
Are the counts the same after the copy or...
Are the counts the same after the copy or below/above?
Perhaps you're using the -P (preserve times) flag with scp.

Why not try ls -l of a file you did copy and check it's timestamp.
11,349
Posted By RudiC
Use signed numbers with all the time tests in...
Use signed numbers with all the time tests in find. man find:So, if you want to find files copied/modified within the last 120 minutes, use -120. Trying to find files dealt with EXACTLY 120 min ago,...
2,220
Posted By Scrutinizer
I mean why do \370380CoverPage124007001.pdf ...
I mean why do
\370380CoverPage124007001.pdf
\370386CoverPage124007007.pdf
\370387CoverPage124007008.pdf
get used and why do:
\370381CoverPage124007002.pdf
\370382CoverPage124007003.pdf...
2,220
Posted By Scrutinizer
I mean, why do: \370381CoverPage124007002.pdf ...
I mean, why do:
\370381CoverPage124007002.pdf
\370382CoverPage124007003.pdf
\370383CoverPage124007004.pdf
\370384CoverPage124007005.pdf
\370385CoverPage124007006.pdf
not get used?
2,220
Posted By Scrutinizer
By what criterion do entries in allfile_dump.txt...
By what criterion do entries in allfile_dump.txt get used or not ?
2,220
Posted By Scrutinizer
Do you mean like this? sed 's/^\\/del "/;...
Do you mean like this?
sed 's/^\\/del "/; s/$/"/' file
Forum: HP-UX 04-11-2013
7,195
Posted By vbe
Its passwd d ... in HP-UX... look at the man...
Its passwd d ... in HP-UX... look at the man pages...
3,837
Posted By hanson44
Yes, you are taking the right approach. A few...
Yes, you are taking the right approach. A few suggestions:

Do enough testing with fake accounts to verify correct operation.
At each step of testing, think of ways to make the script malfunction....
3,837
Posted By DGPickett
Yes, a developer should not test his own stuff! ...
Yes, a developer should not test his own stuff!

Group code review turns on circuits in your brain that see errors you ignored before. I call it the audience effect.
The dialectic tension...
2,583
Posted By anbu23
$ file_name1=ryk11603_PLK5692601_RKYADAV.PDF $...
$ file_name1=ryk11603_PLK5692601_RKYADAV.PDF
$ echo ${file_name1}| cut -d"#" -f2 | tr [:lower:] [:upper:] | sed "s/\([^_]*\)_PLK\([0-9]*\).*PDF/\1_\2.pdf/"
RYK11603_5692601.pdf
2,583
Posted By panyam
Pls post the sample possible inputs and the...
Pls post the sample possible inputs and the output expected.
2,583
Posted By hanson44
Here is a suggestion: $ echo $file_name1 ...
Here is a suggestion:
$ echo $file_name1
RYK11603_PLK5692601_RKYADAV_RHGT_GHTH.PDF
$ echo $file_name1 | sed "s/\(.*\)_PLK\([0-9]*\)_.*/\1_\2.pdf/"
RYK11603_5692601.pdf
2,583
Posted By Scrutinizer
@tadavricky. I tried you original solution on...
@tadavricky. I tried you original solution on Solaris 10 and it worked without a hitch..
As an alternative you could try:
printf "%s\n" "${file_name1}"| awk -F'[-~_][A-Z]*' '{sub(/.*#/,x); print...
2,583
Posted By Scrutinizer
Try: printf "%s\n" "${i}"| cut -d"#" -f2| sed...
Try:
printf "%s\n" "${i}"| cut -d"#" -f2| sed "s/\([[:punct:][:alnum:]]*\)_${var1_upper}_\([[:punct:][:alnum:]]*\)\.PDF/\1_${var1_upper}.pdf/"
It finally dawned on me that [!-~] is of course the...
2,583
Posted By Scrutinizer
@panyam, with GNU sed, I get: $ printf "%s\n"...
@panyam, with GNU sed, I get:
$ printf "%s\n" "${file_name1}"| cut -d"#" -f2| gsed "s/\([!-~]*\)_PLK\([0-9]*\)_\([!-~]*\).PDF/\1_\2.pdf/"
RYK11603_5692601.pdf
must be down to GNU sed versions...
2,583
Posted By panyam
Something like this: echo...
Something like this:

echo "RYK11603_PLK5692601_RKYADAV.PDF" | sed 's/\([A-Z0-9].*\)_[A-Z]*\([0-9].*\)_.*/\1_\2.pdf/'


Scrutinizer: Even for me the code provided by "yadavricky" does not gave...
2,583
Posted By Scrutinizer
I tried your command and it seems to work for...
I tried your command and it seems to work for your input:
$ file_name1=RYK11603_PLK5692601_RKYADAV.PDF
$ printf "%s\n" "${file_name1}"| cut -d"#" -f2| sed...
2,583
Posted By anbu23
$ echo ${file_name1}| cut -d"#" -f2| sed...
$ echo ${file_name1}| cut -d"#" -f2| sed "s/\([^_]*\)_PLK\([0-9]*\).*PDF/\1_\2.pdf/"
RYK11603_5692601.pdf
3,431
Posted By Franklin52
Try something like this: var1="RKY5807" ...
Try something like this:
var1="RKY5807"
var2="HMN55303"

new_var=$(awk -F"," -v v1="$var1" -v v2="$var2" '$1==v1 && $2==v2{print $3}')
11,785
Posted By vgersh99
echo...
echo "./mydata/abc/you_data/xyz/OTHER_DATA/zsoddata_testsod_labl_20120111_1.zip" | sed 's#.*/[^_][^_]*_\([^_][^_]*\).*#\1#'
11,785
Posted By elixir_sinari
newvar=$(echo "$var"|sed -n...
newvar=$(echo "$var"|sed -n 's:^\(/[^/]\{1,\}/[^/]\{1,\}\).*:\1:p')
Showing results 1 to 24 of 24

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