Skip to content

Edit field with date in .csv

I have .csv file with lines like this: and i need to change all date and time to this: I think it’s possible using awk and date but until now nothing worked. Answer Some perl: That removes the last 2 comma-separated fields from each line, deletes the fractional time and timezone, reformats the time and …

Getting Output from Cisco C40 via Bash

Background We have a handful of Cisco C40s that I’m trying to automate via bash (although I’d be open to alternatives). I need to log into it, dial an IP, get back the call ID that’s returned, and then use that CallID to send a DTMF tone to the far end. I’m able to get about 90% of the…

How to write a bash script to merge several file into one

I am using the Linux system. I would like to write a script to do these things below. I have few folders named Folder 1, Folder 2, Folder 3 …Folder 100 saved in test.In each folder I have a file named file.txt. How can I write a script to merge the files together. I type one script by myself, However

What does the output of this program means?

I am trying to get the maximum virtual memory of the current process in Linux. And I am using getrlimit() I get -1 in both values. Shouldn’t I expect the virtual memory max allowed for the current process ? Answer The value RLIM_INFINITY denotes no limit on a resource (both in the structure returned by …

Linux IO operator ‘>’

I have cronjob as jstack > error.log every second to get the snapshot of error. My problem is if I use > operator in linux does it close file also or keep the file open? Answer Whats the problem, look for open files in system and check if the file is still open, lsof | grep <your filename>. You wi…

How does the word count program count hidden files?

After creating a few directories and hidden files and running the following commands I get a difference in the total returned by the word count program. The command returns one more count. Why is this? Answer This line is not shown with -1.