General :: Call Another Bash Script To Run On A Subfolder?
Sep 29, 2010
I want my bash script to run scripts located on a different folder. If it is also located on the same folder with my script, it will go like this:
on my $HOME folder: (this_script.sh, backup.sh, restore.sh, purge.sh)
#!/bin/bash
./backup.sh
./restore.sh
./purge.sh
But what if, on my $HOME folder: (this_script.sh)
$HOME/scripts folder: ( backup.sh,restore.sh, purge.sh )
Below doesn't work...
#!/bin/bash
./$HOME/scripts/backup.sh
View 5 Replies
ADVERTISEMENT
May 2, 2011
I'm trying to remember how to use the output of a nested Bash builtin call. So `which prog` gives me the path to the program, i'm interested in. Then I would like to get the directory path leading to that program and plug it into 'cd', so i end up in the directory containing the program.
View 5 Replies
View Related
Feb 18, 2011
I'm working on Linux OS (Suse/redhat) and trying to format a linux partition from a c program. Is there a way to do this without using : 'system ("mkfs.ext4 /dev/sdxy")'
View 4 Replies
View Related
Apr 25, 2011
I have a script (bash) that do some editing and stats on different logs (syslog) and output a file (html format). If i want to run the script on a file in a subfolder as the script where in that folder how do i do that?
Code:
makes a file called index.html with some stats from the syslog file.
if i run the script on a file in a subfolder
Code:
the script makes a output in the base folder, i want it to print the file to the test folder. There are multiple subolder and i want a index.html in each of them.
View 3 Replies
View Related
Jul 29, 2011
I create a bash script and I assign a folder variable like:
#!/bin/bash
....
Myvariable_FOLDER_PATH=/PATH/TO/SPECIFIC/SUBFOLDER
is there any way to make another variable with just the specific SUBFOLDER
(?some command?)----> will make My_variable_subfolder = SUBFOLDER
so if I do
echo $Myvariable_FOLDER_PATH
i get: /PATH/TO/SPECIFIC/SUBFOLDER
and echo $My_variable_subfolder
i get: /SUBFOLDER
The tree and path names will change so I jjust want the last subfolder that I will access to access its files.
View 3 Replies
View Related
Sep 21, 2010
First, i have no experience with javascript. I came across an interesting site and I'm curious if I could make a private webpage to call some shell commands or just open a terminal.Yes, i know this could potentially be malicious and possibly illegal. Again it's for my own private usage.
View 1 Replies
View Related
May 24, 2010
I am trying to write a bash script to call from a terminal that will change the terminal title. I am using ubuntu 10.04. The script is meant to be used in the gnome-terminal.
Here is what I have:
Code: #! bin/bash
echo "New title: c"
read title
echo "33]0;$titl07c" -e
[Code]....
it doesn't work
I think the problem has to do with modifying PS1 inside the bash so i tried this:
Code: echo `export PS1="[e]1;u@h:wa]${debian_chroot:+($debian_chroot)}u@h:w$ "` and it still didn't work.
View 1 Replies
View Related
Oct 31, 2010
i am using front end as java and back end RHEL5.i am trying to calling a bash script with java. but i am facing problem.i am using following java coding to use call the bash script
import java.util.*;
import java.io.*;
public class b
[code]....
View 4 Replies
View Related
Mar 21, 2011
why I cannot upload local files to subfolder in my home folder on FTP server? Say, i wanna upload files to /home/haolh/trial/occ/src/occ, but following error msg were given...
commandput "C:Proj rialoccsrcocc" "occ"
error/home/haolh/trial/occ/src/occ: open for write: permission denied
After google this prob, i've tried commands as below but it still failed
chmod 770 /home/haolh/
chown root:haolh /home/haolh/
View 2 Replies
View Related
Jun 30, 2011
Me and my friends have a website about games and stuff. The web hotel we use clears the app-pool when it has been inactive for 15 minutes. We don't have that many users yet so this is a problem because it takes ages to load if it has been inactive. I came up with the brilliant idea of calling the website with a script from my private server at home every 5 minutes or so. That way it would never go down.
I used some lines from another of my scripts:
wget -q -O - http://homepage.se/ > /path/to/a/file.txt
cat /dev/null > /path/to/a/file.txt
and put it in crontab.
The script runs and all and I think it's better now but we can't know for sure if it is the scripts doing. Sometimes it's just as slow as ever and I start to think the script doesn't do anything. I've tried adding more wget-lines to fetch some different pages from the site and now running it every 3rd minute. No difference. Does anyone know another way to call a website in a way that would solve my problems? Am I using the wrong options with wget maybe? I've tried lynx (and piping to file) but it didn't work.
View 7 Replies
View Related
Jul 13, 2010
I was wondering, i have a webfolder and have permissions set to 770 with group being www-data. I would like to give access to one folder to a friend so he can edit images, css, etc. I made that folder 770 with group being site_name with www-data and him being in the group. So far so good it sounds like. However when i use the full path to the directory linux says it doesnt exist.
Is there a way i can make it so he doesnt have r/w file on files inside the parent directories and still access the directory i want to give him?
View 1 Replies
View Related
Jul 29, 2011
I want to delete a subfolder ABC in a main Project folder Globe. It occurs in many subfolders. It is very hectic to search and issue an rm -rf ABC command. I need to make a script for that .
View 4 Replies
View Related
Jul 13, 2011
I have many folders with many subfolders. All I want it to get the folder name and the first subfolder. I tried using ls -R but this give me more than I want it. Let say I have:
dir1/subdir1/sub_1_1/file.a
dir1/subdir1/sub_1_1/file.a2
dir1/subdir1/sub_1_1/file.a3
[code]....
All I want when I execute the command is to show me:
dir1/subdir1
dir1/subdir1
dir1/subdir2
[code]....
View 4 Replies
View Related
Dec 9, 2010
I am attempting to use the zip command with the '-x' option to exclude a folder e.g. 'zip upload.zip public_html -x public_html/jquery/*'. However, parts of this folder are still being added to the archive. I made a shell script (saved as 'compress.sh' and ran as '. compress.sh') to do the archiving so I could test adding nested wildards for multiple subfolder levels.
Code:
#!/bin/bash
rm -f upload.zip
zip -r upload.zip public_html
-x public_html/jquery
[code]....
Each new line I added here that has the nested wildcards made the archive file size a bit smaller. Adding more /*'s than this didn't affect the file size. Even after all this though, there were still a couple megabytes of files and folders from the 'jquery' directory that were added to the archive.
Here's some examples of files and folders that were created after I unzipped the archive:
public_html/jquery/js/tablesorter/addons/pager/icons [folder]
public_html/jquery/js/tablesorter/addons/pager/.svn/entries [file]
public_html/jquery/js/tablesorter/build/.svn/text-base/js.jar.svn-base [file]
Why is it that despite all the -x lines, the files and folders like these were still being added to the archive? How can I simply recursively exclude the entire public_html/jquery folder from the archive?
View 4 Replies
View Related
Mar 8, 2011
how i can use the cal command so it displays the current month and the next month, i know you can use cal -3 9 2007 to show the previous current and next but i just want to display the current and next.
View 9 Replies
View Related
Nov 29, 2010
In practice I have a script that call a java program that call a linux system command. The script if I run it, from a shell functions well,so it is not a java problem. The problem come out when i put this script in a crontab schedulation. The result in this case is that java do not execute the system command. I think it depends on crontab
View 4 Replies
View Related
Mar 1, 2010
How to move folder which have same name in subfolder Path : /root/Documents/untitled_folder/untitled_folder/abc.txt I want to move files from that folder how to do that
Output : /root/Documents/untitled_folder/abc.txt through terminal any idea ? and plz suggest a way to do in all folder present in directory recursevely how to check recursively in all folder's present in directory
./folder1/abc.txt
./folder1/folder1/abc.txt
./folder2/folder2/folder2/bbc.txt
./folder3/folder3/folder3/folder3/my.txt
./folder4/folder4/folder4/folder4/folder4/bcz.txt
./folder5/folder5/ca.txt
[Code]...
View 9 Replies
View Related
Jun 27, 2010
I have a small bash script that compress all folders in a specific folderThe script also:- add a password to the compressed files- delete the original folder after compressionSuppose that this script is called "rar.sh".At some particular moment, there will not have any folder in the specific folder since they have all been compressed.I want something (a script?) that will check (every minute approximately) if there's new folder in the specific folder.If there's new folder, then execute script rar.shor if there's not new folder, then re-scan in the next minute.
View 2 Replies
View Related
Nov 5, 2009
I have a virtual server which I am hoping to host several sites on. Each of these sites is in its own subfolder in /var/www/http/ Problem is when I set up DNS records they can only point to the http folder itself. I suppose I can just redirect each domain to then go to the required subfolder, but I'd like to keep the URL the user sees as a simple xxxxx.com (without subfolder).
View 3 Replies
View Related
Apr 20, 2010
I am running samba-3.0.21b-2 browseable = no, not working on subfolder (worklocal) .. what I missed? work folder already invisible .. but when I entered into it .. I still able to see folder named local..
[work]
public = yes
only guest = no
writable = yes
[code]....
View 4 Replies
View Related
Dec 31, 2009
I have three users in samba file user1
user2
user3
and I have share1 and its subfolder " subshare " the thing i have to do is that, i have 2 assign user1 and user2 to share1 that means user1 and user2 can only access share1 through password and user3 can access only its subfolder "subshare" i have done this upto first level permission of share1 not able to do for its subfolder "subshare"
View 7 Replies
View Related
Apr 10, 2011
i want to know how to call the other file in linux. example i got this code that store into example1.sh and i want to store the data into other file like example2.
View 2 Replies
View Related
Nov 29, 2010
I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:
Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END
[code]...
View 6 Replies
View Related
Jul 17, 2010
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
View 13 Replies
View Related
Sep 28, 2010
what is what is signal 0 in linux system call ?i can't find that in kill -l signal list . i need to know what is signal 0 . * for examples signal 1 is SIGHUP and signal 2 is SIGINIT . what is signal 0 ?
View 1 Replies
View Related
Feb 7, 2010
I am writing a shell script lets say run.sh and i want to call another script lets say test.sh having permissions " root:sys" whereas the permissions for run.sh are "rootther".Problem is that i cannot change the permissions of either of them. run.sh is performing some other important functions as well and test.sh is a system script and i am not supposed to change that.If i do not change the permissions, run.sh simply skips the part where it is suppose to call test.sh.Can anyone tell me how do i call test.sh in run.sh without changing permissions of any of them.
View 2 Replies
View Related
Sep 24, 2010
I had an interview , where the interviewer asked me the question "How to create and call a process in unix". I answered that we can use the command
FORK()/ CLONE() to create a process.
But I didn't have the answer for the second question, how to call a process.
View 2 Replies
View Related
Oct 13, 2010
When I an in Emacs, I want to call info pages like in terminal. E.g., info date will call the date info page, but when I in Emacs, I can only use M-x info call the complete info pages, but I only want to see the date info page. Then which command I should execute in emacs.
View 4 Replies
View Related
Jan 18, 2010
I want to launch other executable from my cpp code. I am aware that system() call may do this , But, problem is that , I want my cpp code to capture the standard hat "called" program is writing to stdout.
View 2 Replies
View Related
Feb 23, 2010
i am trying to run an application code in nfs host.but facing the problem as shown below.can anybody tell what the problem could be?
[code]...
View 2 Replies
View Related