I have this set of lines in a file:
{info}, {info}, {info}, {info},
and I want this file to be like this without the last ",":
{info}, {info}, {info}, {info}
How to do this in bash? Any idea?
You can use sed:
sed
sed '$ s/.$//' your_file
$
s
/
.$
, , /, , :
sed '$ s-.$--' your_file
vim : replace : s, . vim-built in - http://vim.wikia.com/wiki/Search_and_replace
, :$s/.$//g
:$s/.$//g
Source: https://habr.com/ru/post/1615637/More articles:Access to low and high ETS range attribute settings? - pythonHow to run a script when a user uninstalls my package using pip? - pythonCreating a list of dicts from Pandas df - dictionaryPuppet - using node scope variables in a Hiera configuration - puppetHow to update scikit-learn package in anaconda - pythonunorderable types: Vertex()Tensorboard does not display graph (HTML error) - pythonSan Francisco Monospace Font at SKLabelNode - fontsRadio buttons with separate labels for listing using MVC6 tag helpers - enumsHow to make UIPopoverPresentationController translucent for iOS 9 - iosAll Articles