Search Results

Search: Posts Made By: Prasannag87
990
Posted By RudiC
Not to my knowledge. shells need this detour.
Not to my knowledge. shells need this detour.
990
Posted By RudiC
Not bad an approach. Try to escape the / inside...
Not bad an approach. Try to escape the / inside the string.
879
Posted By RudiC
Try tail -n+2 file.dat | tac | tail -n+2 | tac
Try
tail -n+2 file.dat | tac | tail -n+2 | tac
2,602
Posted By Don Cragun
Maybe something more like: #!/bin/ksh ...
Maybe something more like:
#!/bin/ksh
FILE_NAME_WO_EXTN="whatever"
YrDoy=`date '+%Y%j'`
filename="${FILE_NAME_WO_EXTN}_$((YrDoy - 1)).ZIP"
printf 'filename has been set to "%s"\n' "$filename"
...
2,602
Posted By Don Cragun
I believe that the output of that script would...
I believe that the output of that script would always be:
doy
and never:
36
If you change:
echo doyto:
printf '%03d\n' $doy
you should get something closer to what you want.
1,220
Posted By itkamaraj
how about this ? same code of @Rudic.. but...
how about this ?

same code of @Rudic.. but just adding exit to read only the first line on all files

for file in *.txt; do awk -F'|' '$1=="\"HD\"" {gsub(/"/,"",$3); print FILENAME, $3;exit}'...
1,220
Posted By RudiC
How about awk -F'|' '$1=="\"HD\""...
How about awk -F'|' '$1=="\"HD\"" {gsub(/"/,"",$3); print FILENAME, $3}' *.txt | sort -k2
9,748
Posted By RudiC
You'll need to experiment a bit. Try find...
You'll need to experiment a bit. Try
find "$INBOUND_PATH" \! -path "$INBOUND_PATH" -prune
9,748
Posted By jlliagre
Thanks for the corrections MiG! I should have...
Thanks for the corrections MiG! I should have test the script I posted ;-)
9,748
Posted By MadeInGermany
There is a bug: -name . only matches if the start...
There is a bug: -name . only matches if the start directory is .
cd "$INBOUND_PATH" && find . -type d ! -name . -prune -o -type f -size 0 \
-exec sh -c 'for i do echo mv "$i"...
23,184
Posted By RudiC
Try to escape the & char with a \ char. ...
Try to escape the & char with a \ char.

---------- Post updated at 12:20 ---------- Previous update was at 12:16 ----------

With an unescaped & the shell will try to put the command line...
2,277
Posted By ahamed101
Something similar... if pgrep "some_pid"...
Something similar...

if pgrep "some_pid" >/dev/null
then
echo "do some stuff"
fi


pgrep = process id grep

--ahamed
2,722
Posted By kalpeer
one simple thing is before reading the file,...
one simple thing is before reading the file, replace the variable in the file.
sed "s:\$JAVA_TOP:$JAVA_TOP:" DATA.csv > /tmp/DATA.csv

read the value from "/tmp/DATA.csv" instead of "DATA.csv"
Showing results 1 to 13 of 13

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