Tagged Questions
2
votes
2answers
72 views
How to put the following information in a CSV file?
I have a text file with the following type of content:
OPERATION_CONTEXT VMD1HTE1A71_ns:.oc.GJ_OAD2 alarm_object 1130
On director: VMD1HTE1A71_ns:.temip.VMD1HTE1A71_director
AT Fri 18 Oct 2013 ...
-1
votes
2answers
57 views
Make a new sniffer [closed]
How can use the Linux-kernel to supervise what is going on, about the new connections, new ports, connected hosts? Like I will do a new sniffer.
Which files should I monitor to know what is going ...
2
votes
3answers
175 views
Analyzing tricky one liners & having handy list of useful ones
Have seen one liners like below & took a little time to analyse exact use & working of it – something like set the value to later one if it is not set.
export ...
3
votes
1answer
57 views
How can I write a sed script to delete numbers from a line?
Sample File
a.b.gg3d 0000000001 0000000001 y
a.b.112a 0000000000 0000000001 y
a.b.gg3s 0000000001 0000000001 y
a.b.1111 0000000000 0000000001 m
I have a file that includes about three thousand ...
3
votes
4answers
119 views
Capture output of a bash command, parse it and store into different bash variables
Explanation:
I have a small bash script which simply runs any Linux command (e.g. say ifconfig)
The typical output of ifconfig is something like this:
eth0 Link encap:Ethernet HWaddr ...
4
votes
1answer
77 views
Capabilities for a script on Linux
If I want to set a capability (capabilities(7)), such as CAP_NET_BIND_SERVICE, on an executable file and that file is a script, do I have to set the capability (setcap(8)) on the interpreter starting ...
1
vote
3answers
77 views
Confused on user and su in linux
How could I run a script as a specific user (non-root)? As this?
sudo su - john /usr/share/script.pl for user john?
0
votes
2answers
192 views
sed - replace complex lines in a file using variables
How do I replace a complex line in a file using sed?
For example I want replace a udev rule in /etc/udev/rules.d/70-persistent-net.rules.
This doesn't work:
OLD_RULE='SUBSYSTEM=="net", ...
2
votes
2answers
188 views
Add a suffix string to end of each line? [duplicate]
I have two files:
file01:
line1
line2
line3
file02:
A
B
C
And I want to get
line1 A
line2 B
line3 C
I could possibly write a Perl script but it is better if I don't need to.
I have tried ...
1
vote
0answers
41 views
Using tcpdump to log blacklisted IPs
I am using tcpdump to log traffic outbound on a network. I would like to be able to log traffic on a host or IP-only basis but then I would like to be able to log large numbers of potentially ...
0
votes
1answer
75 views
when to use double quotes with a variable in shell script? [duplicate]
I am in a confusion with what is meant by the double quotes referring to a variable. For example following two scripts gives the same output. What is really meant by the double quotes?
Script1
...
0
votes
1answer
80 views
Use of .. in Linux scripting and makefiles [closed]
what is the use of .. in linux scripting and in the following makefile?
MODULE =
EQUALIZER = ..
SRCS =
include ${EQUALIZER}/xyz.mak
include ${EQUALIZER}/pqr.mak
0
votes
2answers
213 views
How to create as many variables as needed from shell script(bash)?
I'm making a script for monitoring some user processes with Upstart but, since its for the company I work for, they asked me to do it generic...how's so?
Well, the number of processes being monitored ...
1
vote
1answer
219 views
How to clone a read-only portion of /proc file system
The problem with reading /proc file system is that it is not atomic. I tried using a library (procfs in Python) that wishes to read it, but it has glitches about 5% of the time because the process ...
0
votes
2answers
64 views
Executing a program according to the last modified date
I need to write a script which would execute some executables in a directory according to the last modified date. The oldest should run first. How do I do it?
This is what I have done so far
for f ...