shell

How to run a command recursively on all files except for those under .svn directories

Here is how i run dos2unix recursively on all files: find -exec dos2unix {} \; What do i need to change to make it skip over files under .svn/ directories? ...

Tool to create a call diagram for Korn Shell?

Is there a tool available to create call diagrams or create other documentation from a Korn Shell file? ...

Probem with links Embedding the app engine's shell app within my own app, for help coding

In my own App Engine App, at the browser, I wanted to mess around with new code by simulating having access to the python interpretor's >> within a browser window by embdedding this app --> http://shell.appspot.com/ . One can get shell_20091112.tar.gz at http://code.google.com/p/google-app-engine-samples/downloads/detail?name=shell_200...

ADB rejected shell command (ls -l /data)

I keep getting ADB rejected shell command (ls -l /data): and the command prompt when running adb shell tells me error: device not found although the emulator is open. What I am doing wrong? ...

linux shell file size

I want to get size of file into variable ? How to do that? ls -l | grep testing.txt | cut -f6 -d' ' gave the size but how to store it in shell variable? ...

Command paths as variables in shell scripts

What is the best practice when running external utilities in shell scripts. For example if I want to run 'gzip' in multiple scripts ensuring that a specific gzip binary is used should I make the full path to the binary a variable and just use the variable thoughout the script? GZIP=/home/me/bin/gzip $GZIP somefile $GZIP anotherfile Or...

How can I get and format yesterday's date on the command line?

I have a Perl script which will run in a cron job on linux suse. It will take as input a log file that was generated yesterday. The filename of the log contains the date (i.e. log.20100209) Can I send yesterday's date with the format in the prompt? Should I create an additional script to get the date and execute? If so, how can I do tha...

Python Shell, Logging Commands for Easy Re-Execution

Say I do something like this in a python shell for my Django app: >>>from myapp.models import User >>>user = User.objects.get(pk=5) >>>groups = user.groups.all() What I'd like to do is stash these 3 commands somehow without leaving the shell. The goal being I can quickly restore a similar environment if I restart the shell session lat...

querying for memory details in shell

Hi, Is there a shell command to know about how much memory is being used at a particular moment and details of how much each process is using, how much virtual memory is left etc? ...

bash shell program

!/bin/bash echo Enter the num read n for i in { 1..10 } do m=$(( n*i )) echo "$i * $n" = $m done i got error as for: 8: Illegal number: { kindly suggest a solution ...

Operations that can be performed on Bash shell variables

Hi, I've known several operations we can do to variables in shell, e.g: 1) "#" & "##" operation with ${var#pattern}, we remove "pattern" in the head of ${var}. "*" could be used in the pattern to match everything. And the difference between "#" and "##" is that, "##" will remove the longest match substring while "#" removes the shorte...

How might I obtain an IShellFolder from the active IShellView?

I'm trying to enhance a CFileDialog, and we're using the older version of it (the non-vista one that doesn't use IFileDialog). The older one does allow me to obtain an IShellBrowser, as well as (from that) the active IShellView. What I cannot seem to come up with is a way to get "What IShellFolder does that IShellView refer to?" Equal...

running BLAST (bl2seq) without creating sequence files

I have a script that performs BLAST queries (bl2seq) The script works like this: Get sequence a, sequence b write sequence a to filea write sequence b to fileb run command 'bl2seq -i filea -j fileb -n blastn' get output from STDOUT, parse repeat 20 million times The program bl2seq does not support piping. Is there ...

Resources to learn sh scripting 'just like a normal programming language'

Hi, what is the best resource (book would be nice) to learn sh scripting (the "standard" shell on Unix systems) just like when i would learn a "normal" programming/scripting language ? There are lots of tutorials on certain aspects of shell scripting, they mostly deal with shells in general and unix commands and so on, but i would rat...

How to initialize a file system?

I have some partitions on /dev/sda. I want to remove them all of them programatically. One way is to list all partitions and then delete them one by one. Another way is to just execute dd if=/dev/zero of=/dev/sda The first option failed when I got some problem with my partition table due to which the listing of the current partitions ...

export C #defines as shell variables

In my project, a number of paths to various directories, files and other components of the system are stored as #defines in a filenames.h, a file included by all that need them. It works well for all the various binaries generated by compilation, but the project also includes a few shell scripts that use the same paths. Currently this me...

Which book for windows Shell programming?

I've been looking for a good book for windows shell programming, and the only one I could find is Visual C++ Windows Shell Programming by Dino Eposito: http://www.wintellect.com/BookInformation.aspx?ASIN=1861001843 It is an old book, and I'd like to know if you know of any good resources which could help. I need to develop a couple of ...

BASH file attribute gymnastics: How do I easily get a file with full paths and privileges?

Dear Masters of The Command Line, I have a directory tree for which I want to generate a file that contains on two entries per line: full path for each file and the corresponding privileges of said file. For example, one line might contain: /v1.6.0.24/lib/mylib.jar -r-xr-xr-x The best way to generate the left hand column there appe...

how to add ftp users to an apache from PHP?

how do i go about adding ftp users to an apache web server? i need the user to register from normal web/script and then have an FTP account set up for them automatically. I have seen the cPanel API, and it is pretty decent, but since cPanel costs money, i don't wish to use it for this project. I'm also reluctant to use any other lisence...

module: command not found

I'm attempting to load several modules for building a library on Linux but am told that the command 'module' doesn't exist. I've Googled around and discovered that the solution was to source a directory called "module" which I am unable to locate despite extensive searching. I'm not quite sure what I should and any help would be appreci...