Skip to content

Tag: unix

How to read file in linux command line?

I’m doing this challenge thing and this is one of the levels: An agent on Level 05 has told us about another big hack he’s working on. Apparently someone broke into a popular shopping site, stole all the usernames and passwords and was going to post them online. Luckily, we got to them first and r…

grep string after first occurrence of numbers

How do I get a string after the first occurrence of a number? For example, I have a file with multiple lines: I want to get the following output: Thank you. Answer Imagine the following two input files : A quick solution with awk would be : This line substitutes the first string of anything that does not cont…

Interruption of signal handler with other signal?

Can a signal handler be interrupted by another signal (except of SIGKILL, SIGSTOP)? Therefore, do I need to check for EINTR in my signal handler when calling interruptable syscalls? (Linux and other Unixes) Answer Yes, the execution of a signal handler may itself be interrupted by the delivery of another sign…

Bash Script Unstable Result

I have bash script and I put in the crontab. It runs every 10 minutes. When I run it manually, it gives perfect results. It creates “.tmp” files and these “.tmp” files are not empty, but Crontab results are not as I expected. it only creates “.tmp” files. Contents of &#8220…