Tagged Questions
5
votes
4answers
109 views
Parallel execution of a program on multiple files
I have a small script that loops through all files of a folder and executes a (usually long lasting) command. Basically it's
for file in ./folder/*;
do
./bin/myProgram $file > ./done/$file
...
1
vote
2answers
55 views
how to detect command interpreter from within a shell script [closed]
Possible Duplicate:
How to test what shell I am using in a terminal?
For example the following script
#!/bin/bash
issue_interpreter_name
would issue:
bash
8
votes
6answers
316 views
Text Manipulation Across multiple lines
I Have a file that has text like this:
AAAA
BBBB
CCCC
DDDD
1234
5678
9012
3456
EEEE
7890
etc...
And i want to match up the Alphabetic lines with the Numeric lines so they are like this:
...
0
votes
2answers
45 views
How to generate Zipf-like samples, by using scripting language
Is there any scripting language function (like in python or bash) that samples from a zipf-like distribution, for exponent 0<a<=1.
PS: I am aware of existence of a numpy function that can ...
2
votes
3answers
63 views
dynamic display of a running process?
I am writing a script and acording to that when i run it certain info will be displayed on the output screen.
for example say the constant data displayed is:
my name is mukesh.
i am 27 years old
...
0
votes
2answers
73 views
Autentification on SSH connection in OneLine [closed]
Possible Duplicate:
Shell Script for logging into a ssh server
I need to connect via SSH to a remote server, however I must do this with out interactive mode and with out use Public keys ...
3
votes
1answer
90 views
merging files and getting column values based on id field
bash-3.2$ cat sample.log sample.log.1 sample.log.2
ID COL1 COL2 COL4
1 col1 col2 col4
2 c1 c2 c4
3 co1 co2 co4
ID COL3 COL1
1 col3 col1
2 c3 c1
3 co3 co1
ID COL1 COL2 COL3
1 col1 ...
2
votes
2answers
132 views
Invert results for “for in * do”-loops [closed]
Possible Duplicate:
How do I reverse a for loop?
Is there an easy way to invert a for in loop? For a script I want to process files in their reverse order.
So instead of:
for file in ...
0
votes
3answers
84 views
help with script; if status is this do that if not do something else
I need to write a script that checks on the status of something. If the status "Copying" then exit (or retry in 60 minutes if we want to get fancy.) If all there is nothing returned (based on my ...
3
votes
3answers
115 views
How to make svn look for if there is an update once a minute and if there is call some script?
I am developing a server app. I have a remote machine with Debian that I use for testing. Currently I update the server manually when each new svn version comes out. It is just a testing server and ...
2
votes
3answers
151 views
Keep running a script via ssh
ssh can use to run remote commands.
ssh [email protected] 'long-script.sh'
I run a long script that will take a lot of time, but I want to close my computer and keep running the script in the remote ...
0
votes
1answer
152 views
Script that unpacks a initrd, allows editing of the preseed.cfg and the packs it to cpio and gzip again
I want to program a script that allows what is said in the title. So basically I gunzip the initrd, than unpack the cpio, open vi to allow editing, save, pack with cpio, and gzip again, so nothing ...
0
votes
2answers
63 views
getting file name from the input path to the file in shell scripts
Say that I have a script called script.sh
In the shell I type
script.sh ../folder/file.py
and in that file I know echo $1 will output ../folder/file.py
But is there anyway of getting just the ...
3
votes
4answers
213 views
How to perform a sed in-place substitution that only creates backups of files that were changed?
I ran the following to replace a term used in all files in the current working directory:
$ find . -type f -print0 | xargs -0 sed -i'.bup' -e's/Ms. Johnson/Mrs. Melbin/g'
This performed the word ...
3
votes
1answer
190 views
How to use a value returned by a script in grep filter?
I'm on FreeBSD's csh.
I want to form a row with domains of one user and then use this row to filter exim maillog to get only mail from/to this user's domains.
I wrote a script to form a row from a ...