Skip to content

how to customize select loop in bash

I was wondering if is possible customize the select loop for bash. I have this code: Output is something like this: I would like to order the options in landscape view and also change the prompt [#?] by something else Thanks Answer select displays the PS3 prompt. You could try something like:

how to use git log and grep together?

I am trying to use git log and grep together with pipe. However, it doesn’t seem to work. I am grepping for the bug-id from the git log. Here is what I am doing. Answer You can use git log –grep “BUG-1024”

Running a script in terminal using Linux

Im trying to run this script in the terminal but its not working and says permission denied. scriptEmail is filename. scriptEmail is written as follows: My read write permission Answer As for permissions: Check that your shebang is at the very top of your file, and that it starts exactly with #!; # ! will not…

sys_ functions in syscalls.h are undefined

I’m just making a kernel module. And I meet this warnings: How can I fix this problem? This is my codes: And my workspace is Ubuntu 3.13.0-66-generic. I need to use file descriptor. So, I can’t use filp_ functions(like filp_open). Edit1: My Makefile: obj-m += NAME.o Answer Calling system calls(sys…

Attempting to pass Linux command output into a variable

I have the following code: With the following output: As you can see, gpio pin 123 is set to ‘in’ and 124 is set to ‘out’. However, both gp123 and gp124 are being assigned ‘in’. I am rusty with functions and C. Could you fellas help me out a little please? More specifically…

Removing text after a specific delimeter

I extract all the links from a specific webpage using lynx. It give the following output: I want to do following things. Output only those links which contains /video/ remove the title in the end of the link http://www.example.com/video/1001/The-title-of-video should output only http://www.example.com/video/1…

Echo -e escape sequences?

After days of researching I still don’t understand why : gives me an output of : anb While I understand that echo -e activates the escape sequence , So it should work on the first example but it doesn’t .. I’m lost. I tried same commands in Ubuntu and OpenSuse .. both , same results . Any He…