Posts

Showing posts from August 18, 2018

Can I modify the behaviour of backspace in gnu nano?

Image
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite I tried to configure my nano to more python friendly editor. I wrote the following to my .nanorc set tabsize 4 set tabstospaces I was wondering if I can change the bahavior of backspace such that it removes four spaces at one press if there are only spaces on the left of the cursor and one space if there is at least one non-space character on the left on the cursor? nano share | improve this question asked May 2 at 11:43 novice 1 I can't be sure I'm not really into nano scripting configuration, but it's a very limited editor. And I'm almost sure it will not be possible to script to behaviour in Nano – Kiwy May 2 at 13:03 add a comment  |  up vote 0 down vote favorite I tried to configure my nano to more python friendly editor. I wrote the following to my .nanorc set tabsize 4 set tabstospaces I was wondering if I can change the bahavi

Fill the terminal screen with dots

Image
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite I'd like to create a function draw which fills the terminal with dots. According to http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html: Move the cursor forward N columns: 33[< N>C In the first place, I did this to fill the first column: draw_col() local cols=$(tput cols) local x=0 while [[ $x -lt $cols ]] do echo -en "33[$xC." x=$(( x+1 )) done Why didn't only the first column get fully filled? What's wrong? bash terminal share | improve this question asked May 2 at 12:04 smarber 301 1 2 13 add a comment  |  up vote 0 down vote favorite I'd like to create a function draw which fills the terminal with dots. According to http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html: Move the cursor forward N columns: 33[< N>C In the first place, I did this to fill the first column: draw_col() local cols=$(tput cols) local x=0 whi

I need to find a value in file between >STRING<

Image
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite 1 I have a file: example here: <hello>TestFile</hello> <test>2018-04-30</test> <greetings>mycomputer</greetings> **<Iwanthis>6.1.0</Iwanthis>** <example>20180411</example> blah blah I'm looking to grep the value (in this case 6.1.0) from between 6.1.0 is there an way to grep the file to grab the XXXX value? regards thanks all........ bash grep string share | improve this question edited May 2 at 12:27 asked May 2 at 12:24 Mike Smith 1 1 2 Is this an XML file? – Stephen Kitt May 2 at 12:25 Sorry - this a standard file - Not XML – Mike Smith May 2 at 12:26 I should mention - I need a solution in Bash - sorry for not mentioning it! – Mike Smith May 2 at 12:27 Bash is just a shell, not much of a text editor. You’re looking for a command-line solut