Tagged Questions
0
votes
2answers
59 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
71 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 ...
-5
votes
0answers
46 views
Linux Bash Script [closed]
I am currently in need of a simple Linux script which provides a menu to any user, where they are able to either add or delete a user, where if they choose to add the user they can do so via a text ...
0
votes
2answers
56 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 ...
1
vote
4answers
473 views
Checking if a file exists in several directories
I've been working on this far too long and need some help.
I need a script that will look at files in a directory and see if it exists in one of several directories.
I need something like this:
for ...
11
votes
1answer
1k views
Making a progressbar with “dialog” from rsync output
I'm looking for a way to filter/redirect rsync output in a manner where it can be fed to the "dialog --gauge" command, so I can get a nice looking progressbar during file sync.
Currently I have only ...
1
vote
2answers
115 views
find total ram memory and swap memory
I need to write a script to find total memory and total swap of several linux server (2000+).
I have one trusted server from where I can login to all these 2000 servers without a password.
When I run ...
2
votes
1answer
103 views
bash scripting add arguments
I have created a script which takes parameters and arguments. I want to insert the --help argument.
I already know how to parse normal arguments with -, but I don't know how to parse the -- ones.
to ...
10
votes
2answers
284 views
Shebang line with `#!/usr/bin/env command --argument` fails on Linux
I've got a simple script:
#!/usr/bin/env ruby --verbose
# script.rb
puts "hi"
On my OSX box, it runs fine:
osx% ./script.rb
hi
However, on my linux box, it throws an error
linux% ./script.rb
...
5
votes
4answers
250 views
Testing, from a script, if audio devices are in silent?
Is there a default program where I can check if my audio devices are in silent?
Edit: By silence, I mean that if there is something playing on that (not just activated or opened)
Something like ...
2
votes
1answer
124 views
Access the Shift-Insert clipboard from script
How do I access the Shift-Insert (paste) clipboard from a script? You can see what I use here.
Edit: A demonstration how it works, with xclip:
echo hello | xclip -selection secondary
xclip -o ...
6
votes
3answers
391 views
Difference between commands in bash script and commands in terminal
Are there any differences between commands that you type into the terminal and commands you include in a script?
1
vote
3answers
103 views
Script to insert line into files in sub-dirs
I have a sub-dir tree with varying number of branches and most of
the branches contain .cpp files (many of them). I have a header-file
at the root of the tree that I want to have as a
#include ...
1
vote
2answers
239 views
Concatenate multiple files under subdirectories
My directory structure is given below
x:\Project_2012-158A\Sample_4041
SampleSheet.csv
4041_CGTACG_L002_R1_001.fastq
4041_CGTACG_L002_R2_001.fastq
4041_CGTACG_L006_R2_001.fastq
...
1
vote
1answer
247 views
Extract binaries from pcap using command line (script)
As the title says, I'm looking for a way to extract binaries from PCAP's using the command line. I realize it is possible using Wireshark -> File -> Export -> http objects etc. But tshark doesn't seem ...