shell

.NET Shell Control Library

Looking for a good quality .NET Control library that provides shell capabilities such as folder trees, item lists, right click, file context menu, and OLE drag/drop. Update: (I am asking this for someone else) Specifically want to provide the list of "files" which may be from numerous locations (the results of a search). And then have t...

What's the difference between .bashrc, .bash_profile, and .environment?

I've used a number of different *nix-based systems of the years, and it seems like every flavor of Bash I use has a different algorithm for deciding which startup scripts to run. For the purposes of tasks like setting up environment variables and aliases and printing startup messages (e.g. MOTDs), which startup script is the appropriate...

Cron Job - Command to delete all .flv files everyday

Hello all, I have this command that I run everyday via cron: find /home/get/public_html/videos -daystart -maxdepth 0 -mtime +1 -type f -name "*.flv" |xargs rm -f The problem is that it doesn't delete the .flv files in a directory that are 1 or more days old. How can I correct the above command? EDIT: Paul - the command "ls -l /ho...

How to do a mass rename?

I need to rename files names like this "transform.php?dappName=Test&transformer=YAML&v_id=XXXXX" to just this "XXXXX.txt" How can I do it? I understand that i need more than one "mv" command because they are at least 25000 files. Thanks! ...

filter to reverse lines of a text file

I'm writing a small shell script that needs to reverse the lines of a text file. Is there a standard filter command to do this sort of thing? My specific application is that I'm getting a list of Git commit identifiers, and I want to process them in reverse order: git log --pretty=oneline work...master | grep -v DEBUG: | cut -d' ' -f1 ...

How can a bash script know the directory it is installed in when it is sourced with . operator?

What I'd like to do is to include settings from a file into my current interactive bash shell like this: $ . /path/to/some/dir/.settings The problem is that the .settings script also needs to use the "." operator to include other files like this: . .extra_settings How do I reference the relative path for .extra_settings in the .setti...

Run a command in a shell and keep running the command when you close the session

Hello, I am using Putty to connect to a remote server. What I want to know is if there is any way to write my commands and allow them to keep running after I close the session with Putty. The reason for this is that I do not want to keep the computer ON all the time. Is there any way to do this?. Update with the solution For my questio...

Are there good Java libraries that facilitate building command-line applications?

I need to write a simple command-line application in Java. It would be nice to use a library that takes care of parsing commands and takes care of things like flags and optional/mandatory parameters... UPDATE Something that has built-in TAB completion would be particularly great. ...

How to execute ruby script on some event?

Hi, everyone! I want to execute another ruby script from my Shoes app. I try button "..." do `ruby -rubygems /Users/kemiisto/Desktop/Ruby/gears.rb` end but nothing happens. In the case of other commands, for example button "..." do `open /Applications/TextEdit.app/` end all works fine. Any ideas? ...

Shell script user prompt/input

This is a crude korn shell script that someone else wrote. I don't know much about using shell syntax and I'm not even sure if this is possible. Is there any way for me to run this file and be prompted for the date so that I don't have to manually go into the script and change it each time? For example, I wan to replace the "1/12/09" ...

SSH - a way to transfer files without opening a separate SFTP session?

Not really a programming question, but relevant to many programmers... Let's say I have opened an SSH session to another computer. remote:html avalys$ ls welcome.msg index.html readme.txt remote:html avalys$ Is there any command that I can type in my remote shell that will immediately transfer one of the files in the current...

How to get the bigger icon

I CAN get the associated icon just fine, and draw it accordingly, however, I want to extract the FULL Icon information not just the 32x32 (or the 16x16) pixels that the SHGetFileInfo allows. For instance, I might want to display the 128x128 icon (or even 256x256) that is stored in the icon file inside the executable. And I can only acco...

How do I mount a remote Linux folder in Windows through SSH?

I'm a blind student currently in a system admin/shell programming class. Although ssh works fine for executing commands like ls, pwd, etc editors do not work well with my screen reader and an ssh session. I was wondering if it is possible to mount a Linux folder over ssh so it appears as a windows drive? This way I could edit any files I...

Book about Linux shell programming

Hi, can anyone suggest me a book about linux shell programming? Dazza ...

How to learn your way through Linux's shell

I want to stop losing precious time when dealing with linux/unix's shell. If I could get to understand it all so well, that would be so great. Otherwise: I may end up loosing a day just for setting up a crontab. I'll keep wondering why the shebang in this script doesn't work. I'll keep wondering what's the real difference between: . ...

How to split on NULs in shell

I am using zsh as a shell. I would like to execute the unix find command and put the result into a shell array variable, something like: FILES=($(find . -name '*.bak')) so that I can iterate over the values with something like for F in "$FILES[@]"; do echo "<<$F>>"; done However, my filenames contain spaces at least, and perhaps o...

How can I tell the resolution of scanned PDF from within a shell script?

I have a large collection of documents scanned into PDF format, and I wish to write a shell script that will convert each document to DjVu format. Some documents were scanned at 200dpi, some at 300dpi, and some at 600dpi. Since DjVu is a pixel-based format, I want to be sure I use the same resolution in the target DjVu file as was used...

How can I delete all files in my folder, except Music -subfolder?

Duplicate Unable to remove everything else in a folder except FileA I guess that it is slightly similar to this: delete [^Music] However, it does not work. ...

Shell Script Tilde Expansion

Here is my script: #!/bin/bash echo "Digite o local em que deseja instalar o IGRAFU(pressione enter para instalar em ${HOME}/IGRAFO):" read caminho if test -z $caminho then caminho="${HOME}/IGRAFO" fi echo "O IGRAFU será instalado no diretório: $caminho" mkdir -pv $caminho mv -v ./* $caminho echo "Pronto!" At 'read caminho' I may ...

How to create a right-click context shell shortcut "edit with Emacs"?

Notepad++ automatically adds a shell shortcut so that when you're in Windows Explorer, you can right-click on a file and select "edit with Notepad++". How can I do the same with emacs? I am using GNU Emacs 22.3 for Windows. ...