[ubuntu-in] Listing out dependency of a package on ubuntu

Nitesh Mistry mailbox at mistrynitesh.net
Tue Nov 23 18:13:26 GMT 2010

On Tue, Nov 23, 2010 at 11:29:47PM +0530, Narendra Sisodiya wrote:
> Following command will list out the dependency of a package.
> sudo apt-get install --dry-run eclipse  | sed -n '/The following NEW/{n; :a;
> $!N;s/\n[[:blank:]][[:blank:]]/ /;ta;P;D;}'
> sudo apt-get install --dry-run expect  | sed -n '/The following NEW/{n; :a;
> $!N;s/\n[[:blank:]][[:blank:]]/ /;ta;P;D;}'

Any way to put it into a shell script/alias? Something like:

sudo apt-get install --dry-run $1 | sed -n....

So that "$1" accepts the value given while running that script.

I'm very low on scripting-fu, but like to turn long commands in to aliases
so that I need to type least. :)

Nitesh Mistry | www.mistrynitesh.com
PGP key id: A6FEF696 | 'geekosopher' on freenode irc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/ubuntu-in/attachments/20101123/0e11d796/attachment.pgp 

More information about the ubuntu-in mailing list