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
...
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 ...
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
314 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 ...
0
votes
3answers
70 views
ksh cannot cp from location with space in it?
I am trying to do the following in ksh but keep getting cannot stat message for the cp command:
JMX_ROOT=/bfs-build/build-info/mep_mainline-Linux.latest/core/mainline/automation
...
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 ...
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
150 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 ...
13
votes
3answers
474 views
How do I exit a script in a conditional statement?
I'm writing a bash script where I want to exit if the user is not root. The conditional works fine, but the script does not exit.
[[ `id -u` == 0 ]] || (echo "Must be root to run script"; exit)
...