Skip to content

What is the usage of 2nd parameter in os.execl()

This question is inspired by the comments in Why am I getting an “execv(file, args)” error when using execl()?. When we use The second parameter seems redundant for me, can anyone help explain why we need this parameter? Answer In the old good days without graphical monitors and without mice, a text-only cons…

How to resize the block of a column

I have a single column of a file having many blocks and the blocks are separated by the > symbol. I want to resize all blocks to the same highest length by appending zero below them. My file is given below: file.txt and my expected output is given below I am trying to write a script, but it fails: Answer

ncurses newterm following openpty

I am trying to figure out how to do the following: create a new pseudo-terminal open a ncurses screen running inside the (slave) pseudo terminal fork A) forward I/O from the terminal the program is running in (bash) to the new (slave) terminal OR B) exit leaving the ncurses program running in the new pty. Can…

Trying to find empty files in other user home directory

I want to search for empty files inside the home directory of the user “adam” for example. Now i don’t know the right path for that user, so I need to get it from /etc/passwd with the following command: Output: /home/adam (for example) Then executing this command to find the empty files. Is …