I would like to know how to automate an already made shell script (all the steps of all the commands done on a specific folder) by utilizing a list (a .txt) of all folder names that the shell scripts goes and executes
For example:
In the working folder called main/ there are subfolders named folder1, folder2, folder3.....folder100 and shell script shell.sh.
vi shell.sh
Code:
perl au
I am currently in Afghanistan and do not have access to some of the resources I normally do back in the US. Just accessed this site and it looks promising! Hopefully you will not find my question too much of a waste of your time.
I write mostly Korn Shell and PERL on Solaris systems for the Army.
I am new to shell script. I have two perl scripts for text processing based on two different input files.I would like to have one shell script that run based on conditions.
if(input file) matches word /extraction_reversed/ run perlscript1.pl otherwise run perlscript2.pl.
Shell script to compile in terminal
sh run.sh inputfile > outputfile
Hi Folks,
I have a script that I am using.
Hello Smart People!
I have a perl script that will import xml data into an access db.
I would like to modify it so it will automatcially parse through all xml files in the folder. I swa a post but couldnt get it working.
In the Perl documentation, perlrun(1) suggests launching Perl scripts using a bilingual shell/Perl header:
#!/bin/sh
#! -*-perl-*-
eval 'exec perl -x -wS $0 ${1+"$@"}'
if 0;
What does ${1+"$@"} mean? I tried using "$@" instead (using Bash as /bin/sh), and it seems to work just as well.
Edit
Two answers below say that it's supposed to be ${1:+"$@"}.
watch command to notify on newly created files on linux
How to modify the below command to notify on creating a new file to /usr/local/mydir/ by linux user john ?
watch -d 'ls -l /usr/local/mydir/ | fgrep john'
ie I want to continually monitor and call an another script if any new file is created to /usr/local/mydir/.
As In production I cannot go for any tool instead of shell script.
I created the following Alias in httpd.conf:
alias /aliasedfolder /some/location/on/the/server/folder
<Location /aliasedfolder>
AddHandler cgi-script .pl
Options +FollowSymLinks +ExecCGI
Order allow,deny
Allow from all
AllowOverride None
</Location>
The problem is that i can view images within "aliasedfolder" but i am getting a "file does not exist" error when i run a perl
I have a folder in my server which contains some files. These are automated that means everyday we get new files automatically which will overwrite the old ones. So want to take a back up for this data. How can i copy all these files in to a another folder by renaming the files with current date while copying.
ex : i have a folder named folder1 which contains 4 files.