Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In linux, running the command: du -h test.sh , for example, produces the following output:
4.0K test.h
Run a command from the shell such that the above output is printed in reverse, i.e. :
test.h 4.0K
** note: in du output is seperated by tabs (so use \t in your regex not spaces)
Answer
du -h test.sh | sed -e 's/\(\<.*\>\)\(\t*\)\(\<.*\>\)/\3 \1/g'
^^ note: the use of chuncking the regex in to 3 regex subexpressions via the backslash-paranthesis syntax
^^ note: the use of the \<\> syntax to signify whole words
^^ note the use of \3 \1 in the replacement clause to do the actual swapping.

Question
In linux, running the command: du -h test.sh , for example, produces the following output:
4.0K test.h
Run a command from the shell such that the above output is printed in reverse, i.e. :
test.h 4.0K
** note: in du output is seperated by tabs (so use \t in your regex not spaces)
Answer
?

Question
In linux, running the command: du -h test.sh , for example, produces the following output:
4.0K test.h
Run a command from the shell such that the above output is printed in reverse, i.e. :
test.h 4.0K
** note: in du output is seperated by tabs (so use \t in your regex not spaces)
Answer
du -h test.sh | sed -e 's/\(\<.*\>\)\(\t*\)\(\<.*\>\)/\3 \1/g'
^^ note: the use of chuncking the regex in to 3 regex subexpressions via the backslash-paranthesis syntax
^^ note: the use of the \<\> syntax to signify whole words
^^ note the use of \3 \1 in the replacement clause to do the actual swapping.
If you want to change selection, open document below and click on "Move attachment"

8. Streams and sed -- The Stream Editor
't yet figured it out, we are trying to get that column of byte sizes into a format like + 438 + 1525 + 76 + 92146 so that expr can understand it. Hence, we replace each line with subexpression <span>\2 and a leading + sign. Backquotes give the output of this to expr , which studiously sums them, ignoring any newline characters as though the summation were typed in on a single line. There is one minor

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.