Skip to content

Tag: linux

snmp – timeout when connecting master and agent

Everytime that I run a command to interact the manager(server) to the agent(client) I get ‘snmpget: Timeout’. this happens both ways both are configured to accept connection from remote hosts. I’m new to snmp. I may have forget to do something Answer SNMP protocol uses specific ports (161 &a…

running bash piped comand from mono linux

I am trying to run bash command with pipe using mono process start here is code snippet I am trying single commands works, however pipe commands fails to run, what am I missing here ? I tried running “ps -aux” which runs fine. However ps -aux | grep gnome command failed. I tried these scenarios sc…

Running Java from terminal : cannot find text files

I am using Java in Eclipse for file manipulation like editing, searching, etc. For instance I have two text files. One is “sales.txt” and the other is “employees.txt”. The user is supposed to input a beginning date and ending date as arguments. Then the program finds the dates that mat…

Nested grep with SSH

I have a following Shell command which runs successfully: However, I have to SSH to a particular machine to run this. To avoid this, I modified it in following way which leads to the failure: What is wrong with this command? How can I fix this? Answer Embed your code in a quoted heredoc to avoid needing to mo…

Unix pipe experiment hangs

The problem is that this program won’t output the expected START and END, also not exiting unless I kill it from shell. Answer You have the order of the dup2( existing_fd, new_fd ) parameters reversed. You have another bug that breaks lots of “let’s try out pipe(2)” experiments. You ar…

Can’t use multiplication in arithmetic expression

The above is the content of calculate.sh. If I use +, -, or /, I get the correct answer, but when I use *, it reports an error: How can I resolve this problem? Answer The problem was as pointed by others the fact than the character * is interpreted by your shell, be it in your terminal or your

Converting euid and egid to username and group name

I looked at some of my system logs and its claiming about errors that apply to random effective user id’s and group id’s. For example: I’m just wondering if theres a simple command I can use in the shell to identify the real username and group ID based on the numbers (which in this example i…