[WNYLUG-Users] Shell command suggestions

Aaron E. Durkee aedurkee at yahoo.com
Tue Jul 19 08:55:01 EDT 2011


Hello Joe,
  I usually create a variable with the full path of the command or script and then use the variable in the script.
 
LS=/bin/ls
CP=/bin/mv
export LS CP
 
#some code 
...
for i in `$LS /etc`;do $CP $i /home/config_backup/;done
....
#some more code
 
It helps with porting only one place to change the script if the program or utility is in a different place.


----- Original Message -----
From: Joe <josephj at main.nc.us>
To: Western New York Linux Users Group Users Mailing List <users at wnylug.org>
Cc: 
Sent: Monday, July 18, 2011 10:24 PM
Subject: Re: [WNYLUG-Users] Shell command suggestions

On 07/18/2011 10:58 AM, Tyler Poland wrote:
> Or add the script directory to the path through .bash_profile or 
> comparable depending upon the shell:
> -----
> PATH=$PATH:/path/to/scripts/
> export PATH
> -----
>
> On Mon, Jul 18, 2011 at 10:53 AM, Steve Castelli 
> <scastelli at roadrunner.com <mailto:scastelli at roadrunner.com>> wrote:
>
>     or /home/mylogin/bin
>
>     On Sun, 2011-07-17 at 20:11 -0400, Neal Chapman wrote:
>     > Your scripts need to be on the system path someplace such as
>     /usr/bin
>     > or /usr/sbin.
>     >
>     > On Jul 17, 2011 5:01 PM, "Joe" <josephj at main.nc.us
>     <mailto:josephj at main.nc.us>> wrote:
>     >
>     > _______________________________________________
>     > Users mailing list
>     > Users at wnylug.org <mailto:Users at wnylug.org>
>     > http://wnylug.org/mailman/listinfo/users_wnylug.org
>
>     --
>     Steve Castelli
>    scastelli at roadrunner.com <mailto:scastelli at roadrunner.com>
>     716-380-7494 <tel:716-380-7494>
>
>
>     _______________________________________________
>     Users mailing list
>    Users at wnylug.org <mailto:Users at wnylug.org>
>    http://wnylug.org/mailman/listinfo/users_wnylug.org
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at wnylug.org
> http://wnylug.org/mailman/listinfo/users_wnylug.org
Isn't this more advice about how to get them to execute (which isn't the 
problem - they do)?  I'm talking about the suggestions Linux makes when 
I mis-type one of the commands on the command line.  The response looks 
like it was generated by some sort of search of my package database.

Joe

_______________________________________________
Users mailing list
Users at wnylug.org
http://wnylug.org/mailman/listinfo/users_wnylug.org




More information about the Users mailing list