Re: [Ilugc] Shell script with arguments

2012-07-17 Thread Krishna
On Tue, Jul 17, 2012 at 2:27 PM, Vijay Kumar wrote: > Hi All, > > I need some help/ideas in coming up with a shell script. > > Basically, the script should install 1 or 2 or 3 packages based on the > input arguments. > > For example, if I type in pkgscript.sh a1 a2 a3, it should install all the >

Re: [Ilugc] Shell script with arguments

2012-07-17 Thread Balachandran Sivakumar
Hi, On Tue, Jul 17, 2012 at 5:57 PM, Vijay Kumar wrote: > Hi All, > > I need some help/ideas in coming up with a shell script. > For example, if I type in pkgscript.sh a1 a2 a3, it should install all the > 3 scripts and pkgscript.sh a1 should install only a1. > Use $# and $@. A rough outline is

Re: [Ilugc] Shell script with arguments

2012-07-17 Thread kenneth gonsalves
On Tue, 2012-07-17 at 17:57 +0530, Vijay Kumar wrote: > For example, if I type in pkgscript.sh a1 a2 a3, it should install all > the > 3 scripts and pkgscript.sh a1 should install only a1. > > If a user enters only pkgscript.sh, it should ask for arguments and > then > proceed accordingly. does

[Ilugc] Shell script with arguments

2012-07-17 Thread Vijay Kumar
Hi All, I need some help/ideas in coming up with a shell script. Basically, the script should install 1 or 2 or 3 packages based on the input arguments. For example, if I type in pkgscript.sh a1 a2 a3, it should install all the 3 scripts and pkgscript.sh a1 should install only a1. If a user ent

Re: [Ilugc] shell script to search for a file

2012-04-01 Thread Girish Venkatachalam
On Sun, Apr 1, 2012 at 7:22 PM, Bharath Kumar wrote: > Hi ILUGC members, > > Thanks for your valuable suggestion. I have modified the code in such a way > that if I search for an open office file that has 'spaces' in the name, it > will output the kind of file. > > Essence of the code : > > I wi

Re: [Ilugc] shell script to search for a file

2012-04-01 Thread Bharath Kumar
Hi ILUGC members, Thanks for your valuable suggestion. I have modified the code in such a way that if I search for an open office file that has 'spaces' in the name, it will output the kind of file. Essence of the code : I will create a file in the name that was converted from space format t

Re: [Ilugc] shell script to search for a file

2012-03-25 Thread Girish Venkatachalam
As many have replied to you there are many things you have to learn. But you have made a good beginning. Keep going. Some general observations: 1) Your shell scripting style is not typical. Learn from others and improve. 2) Even the file command is not always accurate. 3) Learn to look at ret

Re: [Ilugc] shell script to search for a file

2012-03-25 Thread prasannatsmkumar
On Sun, Mar 25, 2012 at 11:39 PM, Mehul Ved wrote: > On Sun, Mar 25, 2012 at 10:02 PM, Bharath Kumar > wrote: > > > #!/bin/bash > > echo -e "Input the file that you want to search: c" > > read input > > find ~ -name ${input} > > Use $"input" instead of ${input} > > > echo -e "Input the file that

Re: [Ilugc] shell script to search for a file

2012-03-25 Thread satyaakam goswami
> > #!/bin/bash > echo -e "Input the file that you want to search: c" > read input > find ~ -name ${input} > echo -e "Input the file that you want: c" // Comments : I will copy the > file with the full name that I want > //to find out what type of file > it

Re: [Ilugc] shell script to search for a file

2012-03-25 Thread Mehul Ved
On Sun, Mar 25, 2012 at 10:02 PM, Bharath Kumar wrote: > #!/bin/bash > echo -e "Input the file that you want to search: c" > read input > find ~ -name ${input} Use $"input" instead of ${input} > echo -e "Input the file that you want: c" // Comments : I will copy the file > with the full name t

Re: [Ilugc] shell script to search for a file

2012-03-25 Thread Shakthi Kannan
Hi, --- On Sun, Mar 25, 2012 at 10:02 PM, Bharath Kumar wrote: | But if the file has a gap (like /path/name/Bharath Kumar Letter.pdf) \-- Windows users usually give whitespaces in the filenames/directories. You might want to rename your files, directories so the whitespaces are replaced with und

Re: [Ilugc] shell script to search for a file

2012-03-25 Thread Guruprasad
Hi, On Sun, Mar 25, 2012 at 10:02 PM, Bharath Kumar wrote: > I have written a shell script to find out what type of file is the file I am > searching for. If the resultant file name doesnt have any gap (like > /path/name/Bharath_file.txt) I get the result correctly. But if the file has > a gap

[Ilugc] shell script to search for a file

2012-03-25 Thread Bharath Kumar
Hi ILUGC members, I have written a shell script to find out what type of file is the file I am searching for. If the resultant file name doesnt have any gap (like /path/name/Bharath_file.txt) I get the result correctly. But if the file has a gap (like /path/name/Bharath Kumar Letter.pdf) I get

Re: [Ilugc] Shell script 2 Binary

2011-07-25 Thread Krishna
On Mon, Jul 25, 2011 at 5:26 PM, Akilan R wrote: > On Mon, Jul 25, 2011 at 8:47 PM, Sarma Tangirala > wrote: > > > The user might do something stupid with it and complain. > > > Can you elaborate what you mean by it? Trim quotes while replying. > This thing has already been discussed in the list

Re: [Ilugc] Shell script 2 Binary

2011-07-25 Thread Akilan R
On Mon, Jul 25, 2011 at 8:47 PM, Sarma Tangirala wrote: > The user might do something stupid with it and complain. Can you elaborate what you mean by it? Trim quotes while replying. -- அகிலன் (Akilan R) [ blog.akilan.in ] *I should have no use for a paradise in which I should be deprived of th

Re: [Ilugc] Shell script 2 Binary

2011-07-25 Thread Sarma Tangirala
On 25 July 2011 19:59, Akilan R wrote: > On Mon, Jul 25, 2011 at 6:39 PM, Ganesh Kumar wrote: > > > I want to convert a shell script to a binary executable so that the > > contents of the shell script are not readable and could not be altered > > > > Any specific reason to obscure source rather

Re: [Ilugc] Shell script 2 Binary

2011-07-25 Thread Akilan R
On Mon, Jul 25, 2011 at 6:39 PM, Ganesh Kumar wrote: > I want to convert a shell script to a binary executable so that the > contents of the shell script are not readable and could not be altered > Any specific reason to obscure source rather than keeping it open? -- அகிலன் (Akilan R) [ blog.a

Re: [Ilugc] Shell script 2 Binary

2011-07-25 Thread Girish Venkatachalam
On Mon, Jul 25, 2011 at 6:39 PM, Ganesh Kumar wrote: > Hi, > > I want to convert a shell script to a binary executable so that the > contents of the shell script are not readable and could not be altered > It is an interpreted language. If you want to hide the source use a compiled language. Eve

Re: [Ilugc] Shell script 2 Binary

2011-07-25 Thread Gaurav Paliwal
On Mon, Jul 25, 2011 at 6:39 PM, Ganesh Kumar wrote: > Hi, > > I want to convert a shell script to a binary executable so that the > contents of the shell script are not readable and could not be altered > > Any tolls available to convert sell script to binary file. > Tried this : http://nixcraf

[Ilugc] Shell script 2 Binary

2011-07-25 Thread Ganesh Kumar
Hi, I want to convert a shell script to a binary executable so that the contents of the shell script are not readable and could not be altered Any tolls available to convert sell script to binary file. please guide me.. -Ganesh. ___ ILUGC Mailing Lis

Re: [Ilugc] Shell Script

2011-03-08 Thread Rajagopal Swaminathan
Greetings, On 3/9/11, Kannan wrote: > Hi Friends.. > > I have read a shell script in net, which is doing the predictive text entry > for the command cd and completion. > > http://dpaste.com/hold/482046/ > > But in this file, I can't understand even a single line. > > Can u guys help me to underst

Re: [Ilugc] Shell Script

2011-03-08 Thread kish
On Wed, Mar 9, 2011 at 12:57 AM, Kannan wrote: > http://dpaste.com/hold/482046/ > Can u guys help me to understand that.. To do programming in that level in > shell, is there any guide for that.If u have any links share with me guys. Follow the examples here. http://tldp.org/LDP/abs/abs-guide.

[Ilugc] Shell Script

2011-03-08 Thread Kannan
Hi Friends.. I have read a shell script in net, which is doing the predictive text entry for the command cd and completion. http://dpaste.com/hold/482046/ But in this file, I can't understand even a single line. Can u guys help me to understand that.. To do programming in that level in shell, i

Re: [Ilugc] shell script - changing directory

2009-12-29 Thread Varrun Ramani
2009/12/29 Shakthi Kannan > > Everytime? These are new requirements :) You had only asked as to how > to cd to a directory from a script. > > Sorry about that. > > export PC='cd /path/to/project/directory' > > Yeah, that works. Thanks. 2009/12/29 Bharathi Subramanian > > Instead of script,

Re: [Ilugc] shell script - changing directory

2009-12-29 Thread Gourav Shah
> export PC='cd /path/to/project/directory' > > Source your ~/.bashrc once: > > $ source ~/.bashrc > > and then use: > > $ $PC > > this should work. however there is a better option than exporting command line as a environment variable => specify an alias in bashrc http://linux.about.com/li

Re: [Ilugc] shell script - changing directory

2009-12-29 Thread Raja Subramanian
On Tue, Dec 29, 2009 at 9:44 PM, Varrun Ramani wrote: > Yes, that works, but thats as bad as typing a cd command everytime. I want > to run a short command like "pc" (for project change :) ) by copying it to > /sbin If you copy your binaries or scripts into /sbin, you will break your system in we

Re: [Ilugc] shell script - changing directory

2009-12-29 Thread Bharathi Subramanian
Varrun Ramani said: Instead of script, try to use alias command. alias pc='cd /home/varrun/Desktop/todo/project' OR use CDPATH Bye :) -- Bharathi S ___ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Re: [Ilugc] shell script - changing directory

2009-12-29 Thread Shakthi Kannan
Hi, --- On Tue, Dec 29, 2009 at 9:44 PM, Varrun Ramani wrote: | Yes, that works, but thats as bad as typing a cd command everytime. \-- Everytime? These are new requirements :) You had only asked as to how to cd to a directory from a script. --- | I want | to run a short command like "pc" (for

Re: [Ilugc] shell script - changing directory

2009-12-29 Thread Varrun Ramani
2009/12/29 Shakthi Kannan > > Try: > > $ source your-script.sh > Yes, that works, but thats as bad as typing a cd command everytime. I want to run a short command like "pc" (for project change :) ) by copying it to /sbin 2009/12/29 Abishek Goda > > Well, I think it should not change the dir

Re: [Ilugc] shell script - changing directory

2009-12-29 Thread Abishek Goda
Hi, > I was writing a few lines of script to change the  *pwd* of my BASH to my > *project workspace* whenever i call it (because its a long path) > > #!/bin/bash > DIRECTORY="/home/varrun/Desktop/TODO/Final_yr_project" > if [ -d "$DIRECTORY" ]; then >        echo "exists" >        cd  $DIRECTORY >

Re: [Ilugc] shell script - changing directory

2009-12-28 Thread Shakthi Kannan
Hi, --- On Tue, Dec 29, 2009 at 1:05 PM, Varrun Ramani wrote: | When i run it, the directory of my terminal does *not* change i guess | because a child process cannot pass arguments to a parent process. \-- Try: $ source your-script.sh SK -- Shakthi Kannan http://www.shakthimaan.com __

Re: [Ilugc] shell script - changing directory

2009-12-28 Thread Roshan Mathews
On Tue, Dec 29, 2009 at 1:05 PM, Varrun Ramani wrote: > When i run it, the directory of my terminal does *not* change i guess > because a child process cannot pass arguments to a parent process. > Is there any other way i can do this? > Instead of running it as $ ./script or $ sh ./script try $ so

[Ilugc] shell script - changing directory

2009-12-28 Thread Varrun Ramani
Hi I was writing a few lines of script to change the *pwd* of my BASH to my *project workspace* whenever i call it (because its a long path) #!/bin/bash DIRECTORY="/home/varrun/Desktop/TODO/Final_yr_project" if [ -d "$DIRECTORY" ]; then echo "exists" cd $DIRECTORY else e

Re: [Ilugc] shell script with timed execution

2009-11-25 Thread Bharathi Subramanian
On 5:34pm, S.Selvam wrote: > 1) The xlib window which i mentioned was created with a seismic > unix(SU) command( suxwigb ). suxwigb cannot be replaced by notify-send or xmessage. So check for time-out option in that command or continue with your current technique. Bye :) -- Bharathi S ___

Re: [Ilugc] shell script with timed execution

2009-11-25 Thread S.Selvam
On Wed, Nov 25, 2009 at 1:17 PM, Bharathi Subramanian < sbhara...@midascomm.com> wrote: > On 10:42am, S.Selvam wrote: > > > > > I have shell script which opens up a xlib window, which happens > > > > in a loop I want each window to fade away after a certain period > > > > of time( 1 min for eg ).

Re: [Ilugc] shell script with timed execution

2009-11-24 Thread Bharathi Subramanian
On 10:42am, S.Selvam wrote: > > > I have shell script which opens up a xlib window, which happens > > > in a loop I want each window to fade away after a certain period > > > of time( 1 min for eg ). > I dont know how that could be achieved using notify-send, still it is > interesting command to

Re: [Ilugc] shell script with timed execution

2009-11-24 Thread S.Selvam
On Tue, Nov 24, 2009 at 9:19 PM, mohan L wrote: > On Tue, Nov 24, 2009 at 7:13 PM, S.Selvam wrote: > > > Hi, > > > > I need a little push up, > > > > I have shell script which opens up a xlib window, which happens in a > loop. > > I want each window to fade away after a certain period of time( 1

Re: [Ilugc] shell script with timed execution

2009-11-24 Thread mohan L
On Tue, Nov 24, 2009 at 7:13 PM, S.Selvam wrote: > Hi, > > I need a little push up, > > I have shell script which opens up a xlib window, which happens in a loop. > I want each window to fade away after a certain period of time( 1 min for > eg > ). > > The desktop notification specification is fo

Re: [Ilugc] shell script with timed execution

2009-11-24 Thread Bharathi Subramanian
> I have shell script which opens up a xlib window, which happens in a > loop. I want each window to fade away after a certain period of > time( 1 min for eg). man notify-send OR xmessage Bye :) -- Bharathi S ___ To unsubscribe, email ilugc-requ...@ae.

[Ilugc] shell script with timed execution

2009-11-24 Thread S.Selvam
Hi, I need a little push up, I have shell script which opens up a xlib window, which happens in a loop. I want each window to fade away after a certain period of time( 1 min for eg ). My algorithm is as follow, for loop rsync a file from remote directory X Display the file for 1 min

Re: [Ilugc] Shell-script when cron'ed does not send mail (using "sendmail")

2009-01-18 Thread S.Selvam Siva
On Tue, Jan 13, 2009 at 2:57 PM, Arun Khan wrote: > Are you executing the job as a regular user or system cron? > Accordingly, you must add MAILTO= either in /etc/crontab or > the user's crontab. Hi, MAILTO= guided me to find what was the problem with sendmail when cronned. The Problem was " se

Re: [Ilugc] Shell-script when cron'ed does not send mail (using "sendmail")

2009-01-13 Thread Arun Khan
On Tuesday 13 Jan 2009, S.Selvam Siva wrote: > Hi, > > We wrote a shell script which will do some posting work and need to > send the details of the work(posting). > It works fine when it is not cronned ,but it does not send mail when > cronned. Are you executing the job as a regular user or syste

RE: [Ilugc] Shell-script when cron'ed does not send mail (using"sendmail")

2009-01-13 Thread Sivakumar Gopalan
> > echo "password" | sudo -u "username" -S script-to-send-mail.sh > > please guide me on this problem Is "script-to-send-mail.sh" accessible without path from cron Did you happen to check the cron log to see what went wrong ? Rgds, Siva. PS: why do you want to change to appropriate user in

[Ilugc] Shell-script when cron'ed does not send mail (using "sendmail")

2009-01-13 Thread S.Selvam Siva
Hi, We wrote a shell script which will do some posting work and need to send the details of the work(posting). It works fine when it is not cronned ,but it does not send mail when cronned. I googled on this and found that we need some authentication for sendmail to work when it is cronned. I tried