How to remove leading and trailing spaces from a linux variable
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have variable named tablename and it has leading and trailing spaces (for eg tablename= yyy ). I want to remove the leading and trailing spaces (OUTPUT : tablename=yyy) and write this variable to file without any space using shell script
shell-script shell
add a comment |Â
up vote
0
down vote
favorite
I have variable named tablename and it has leading and trailing spaces (for eg tablename= yyy ). I want to remove the leading and trailing spaces (OUTPUT : tablename=yyy) and write this variable to file without any space using shell script
shell-script shell
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have variable named tablename and it has leading and trailing spaces (for eg tablename= yyy ). I want to remove the leading and trailing spaces (OUTPUT : tablename=yyy) and write this variable to file without any space using shell script
shell-script shell
I have variable named tablename and it has leading and trailing spaces (for eg tablename= yyy ). I want to remove the leading and trailing spaces (OUTPUT : tablename=yyy) and write this variable to file without any space using shell script
shell-script shell
shell-script shell
asked 5 mins ago
Chai
71
71
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476455%2fhow-to-remove-leading-and-trailing-spaces-from-a-linux-variable%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password