Search Results

Search: Posts Made By: ashok.k
5,740
Posted By Scrutinizer
Try: grep '^..AB...Y' file
Try:
grep '^..AB...Y' file
11,513
Posted By panyam
Depends on how your config file is!!! Pls...
Depends on how your config file is!!!

Pls post sample input (both config and folder) and expected output.

Regards
Ravi
11,513
Posted By KenJackson
If the server is at a known, fixed IP address,...
If the server is at a known, fixed IP address, you can assign it two names in /etc/hosts like this. Then either name will connect you to the same server. 192.168.1.21 serverA serverB
Then make a...
3,833
Posted By Franklin52
One way could be something like this: ...
One way could be something like this:
file="lastline.txt"

lastchar=$(od -An -t dC $file |awk 'NF{c=$NF}END{print c}')
if [ $lastchar = "10" ]
then
echo "file is OK"
else
echo >> $file
fi
3,833
Posted By Franklin52
Have a read of this post: ...
Have a read of this post:

https://www.unix.com/shell-programming-scripting/57511-sed-skipping-last-line-file.html#5

This is Useless Use of Cat (http://partmaps.org/era/unix/award.html):
cat...
1,621
Posted By neutronscott
should be good enough with sed...
should be good enough with
sed 's/SCORE=.*/SCORE=/'
1,621
Posted By Corona688
$ means "must match until the end of the line". ...
$ means "must match until the end of the line". .* means "match zero or more of any character". a* would mean "match 1 or more a's".

So 's/SCORE=.*$/SCORE=\r/g means match SCORE (at any point in...
1,621
Posted By Corona688
You're welcome. You might want to read it too. ...
You're welcome. You might want to read it too.



cat $file | sed 's/SCORE=.*$/SCORE=\r/g' > newfile

cat $file | sed 's/SCORE=.*$/SCORE=/' > newfile That's also a useless use of cat...
Showing results 1 to 8 of 8

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