Software :: Calling A Bash Shell Script From Within Another Script?

Apr 9, 2010

I am trying to call a script say mkdir.sh into another script that will make use of the dir's which are created in the first script. I know that I could code it all together, but I am trying to avoid rewriting the mkdir script as it is long.

View 7 Replies


ADVERTISEMENT

General :: How To Exit Out Of The Calling Shell Script

Aug 18, 2009

I have 2 shell scripts, script1.sh and script2.sh. I call script2.sh from within script1.sh ( by simple ./script2.sh command). Based on some condition, i use exit 0 to exit out of script2.sh. I was trying to find if i can exit out of script1.sh as well at once. below is the example

script1.sh
#!/bin/bash
echo "Before ..."

[code]....

When i execute below is the output

Before ...
There was problem file is empty
The Script will Exit. Please fix the issue and run again...
After ...

I am trying to exit out of script1.sh as well so that i dont print "After ..."

View 3 Replies View Related

Programming :: Calling Bash Script In Php?

Jul 17, 2010

I have a bash script that changes the iptables.Now i call this bash script in my php code.When this bash script is running the part of code that contains iptables instruction is not running because we need to be in superuser mode(root)

View 14 Replies View Related

General :: Calling A Shell Script To Make Few Builds

Jul 27, 2011

I am setting up a cron job, where i am calling a shell script to make few builds. I got struck at a point, need some expert inputs to proceed further. The script is categorized in 5 parts and in the last part while building software it asks for few questions like:-

1. Build mode choice
2. normal build
3. Copy Images
4. Arch

User manually has to input ans for these questions:-
1
yes
n
64

The ans's are fixed and this won't change. How shall i hard-code them or do something in the script so as when script flow reaches to this point it automatically take's these value. So far the cron job is not getting completed as it's waiting for user to key in these values manually. I had faced similar issue while building kernel modules but there it was easier as i had to take default values always:-

View 2 Replies View Related

Programming :: Calling Vars In A For Loop In A Shell Script?

Oct 8, 2010

# variable declaration
stt=10
enn=20
stp=1

# I want to do it in the following structure but not sure how to call # the stt, enn and stp in a for loop

for (( i = $stt; i -le $enn; i=i + $stp ))
do
blah blah
done

View 9 Replies View Related

Ubuntu :: Calling Firefox Macros From Bash?

Nov 27, 2010

I would like to call some firefox macros from bash so that I can manipulate them in some scripts. Does anyone know how to do that?Currently I'm using the imacros firefox add-in

View 1 Replies View Related

Software :: Calling DB User From Separate File In Shell Script?

May 23, 2011

I need to execute a SQL via shell script and i am connecting to Oracle DB by this way $USERNAME1/$PASSWORD1@$STRING1 and i need to get username, password and string from someother file stored in the Unix Directory. $Username, $Password and $String is stored in File A in Path A and i want to call it in the test.sh in Path B.

Format of File A.txt
Username=test_db
Password=*****
Instance=ORACLEDB

View 3 Replies View Related

Ubuntu :: BASH Quote - Calling Commands Stored In A Variable?

Feb 19, 2010

I am having some weird problems with calling commands stored in a variable (I need to do this to assemble a command with a bunch of parameters automatically and then execute it).Example code that will replicate the weirdness:

$ echo "hello world" > "test file.txt"
$ cat "test file.txt"
hello world

[code]....

I would expect the output to be:

hello world

What happens to the quotes? I have tried various combinations of single quotes, escaped quotes, etc, but it seems like quotes in a variable are not evaluated as quotes when that variable is executed.

View 9 Replies View Related

Programming :: Bash - Calling A Specific Variable Based On User Input?

May 3, 2011

I'm trying to call a specific variable based on a user selection. For example:

Code: Select a file:

[1] foo.tar
[2] bar.tar

Enter a selection: I have already coded each possible selection to have its own variable. If the user selects 2 I need to select $SELECTED_TAR2, or if they select 1 I need to select $SELECTED_TAR1 and then do something like this behind the scenes:

Code: cp /home/user/$SELECTED_TAR2 /home/user/backup/$SELECTED_TAR2

I was thinking something like this:

Code: echo "Enter a selection: "
read -e SELECTED_NUMBER
cp /home/user/$SELECTED_TAR$SELECTED_NUMBER /home/user/backup

[code]....

View 2 Replies View Related

Software :: Bash Script Calling Make Files With CFLAGS Prepended?

Feb 6, 2010

Most all of this works when I execute it manually, but I cannot figure out how to get a bash script to execute it automatically.In this particular case, I am trying to build the xorg utilities. If I manually step through the process, prepending the commands with CFLAGS, LDFLAGS, etc, all of the packages build.So I created a bash script, test.sh:

Code:
#!/bin/bash
export INITFS=/initfs

[code]...

View 5 Replies View Related

Fedora :: Stuck With Bash Shell / Changing Default Shell To Tcsh?

Mar 14, 2010

I want to change my default shell to tcsh. I used

Code:
usermod -s /bin/tcsh username
command as given at url

But if I open a new shell, it is still a bash shell.

How do I make my default shell as tcsh?

View 6 Replies View Related

Programming :: Bash-shell-like Less Functionality In The Python Shell?

Jun 25, 2010

Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?

Example:

Code:

>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...

I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.

View 4 Replies View Related

Programming :: Calling Bash Script With More Than One Variable From Python Script?

Oct 4, 2010

I am calling a bash shell script from a python script trying to pass several arguments to the bash script with no succes can this be done? I have researched (google) with no clear indication of how to achieve this. Using "os.system"

View 4 Replies View Related

Ubuntu :: Does It Use Bash Or Some Other Shell

Sep 16, 2010

Does it use Bash or some other shell?

View 2 Replies View Related

General :: How To Use Foreach In Bash Shell

Mar 25, 2010

I used c-shell previously in unix. One of the useful command I used frequently is foreach.> foreach a (`cat list`)>> echo $a need to use bash shell now instead, and realized that I can't use foreach anymore. The command is not found. Does anyone knows if there is similar command / function in bash shell?

View 9 Replies View Related

General :: Use Bash Shell When I Run A Program From It?

May 11, 2011

So I open firefox from my bash shell with:

Code:
firefox google.ca
it opens firefox, I can browse, etc.
Now if I alt-tab back into my shell, i can't enter any commands in the shell.

I know that i can do this if I close firefox, but I want to keep working in my shell with firefox still open.

Is this possible?

View 6 Replies View Related

Software :: Get The 'bash' Or 'csh' Shell From Within Gvim?

Apr 8, 2010

I use ":!shell_command<enter>" OR ":sh<enter>" in gvim to execute shell commands or to get a shell. But I am getting an 'sh' shell. Is there a way to get the 'bash' or 'csh' shell from within gvim?

View 1 Replies View Related

Software :: IDE For Bash / Shell Programming

Mar 24, 2010

I just wanna ask if there's a ide for bash/shell programming?

View 2 Replies View Related

Programming :: Three Scripts - Using Bash As Shell

Feb 9, 2010

I am looking for three scripts (using bash as shell): to print out a list only with directories (no files) that they are found in running directory (no in subdirectories) to print out a list only with files (no directories) that they are bigger than 10Kb and are found in running directory (and in subdirectories) to print in the screen the lines of file with accidental order.

View 13 Replies View Related

CentOS 5 :: Bash Shell Corrupt

Feb 1, 2011

I just needed some help with running the bash shell. I think I might have accidentally corrupted a file when I was looking through the /bin dir. Anyways, whenever I login to my server via SSH I get the following output:

View 1 Replies View Related

Debian :: Creating A Bash-shell Script

Dec 1, 2015

how to do in Debian

1. am required to create a bash-shell script called terminator that terminates all processes of a name given to the shell script as an argument. Make sure the terminator shell script will not take any crucial file system services as arguments.

2. Show how you would configure an Ethernet card by reapplying your existing IP and network mask

3. Install a workable nfs file sharing system between your system and a remote system, using optimum values for resize and wsize.To demonstrate send a 512Mb block of random data between client and server using the dd command.Write down the relevant steps and procedures

View 6 Replies View Related

Fedora Installation :: Use Tcshell Instead Of Bash Shell?

Nov 24, 2009

how to install and use tcshell instead of bash shell...

I run this command but it still dosent work

# yum install tcsh

after installing I use this command to setting it as a default login

$ which csh

but it not work yet...

View 5 Replies View Related

OpenSUSE :: Gnome Terminal: How To Get The Bash Shell

Mar 17, 2010

i've finally got a NIX environment...yipee! Installed opensuse 11.2 in a dual boot with windoze with no problem whatsoever. unfortunately, my NIX skills are sadly dated or maybe things have changed or both. in any case, i have a rather trivial problem that i have not been able to figure out.

i go to gnome terminal to get to the bash shell, no problem except when i do things like cat, less and so on. the commands do what they do then when done the last line output is "some text" and "(END)" - at the completion of the command it does not return to the bash shell. i've tried ctrl-everything, enter, escape, actually all keystrokes i can think of to get back to the bash shell...no luck. man and docs have not been helpful or i simply missed the answer (i'm a little saturated at this point).the only thing i've been able to do to solve my dilema is close the terminal an start a new instance, not elegant but works.

View 8 Replies View Related

OpenSUSE :: Customizing A Bash Shell Prompt (PS1)?

Jul 28, 2010

I changed the default SUSE prompt setting by modifying the shell variable PS1 to display the following information:

u : the username of the current user
h : the hostname up to the first '.'
w : the current working directory, with $HOME abbreviated with a tilde

I used export command to setup a new shell prompt:

export PS1="[u@h: w]$ " To add colors to the shell prompt and make a regular user prompt blue I used the following command syntax:export PS1="e[0;34m[u@h: w]$ e[m "

[Code]...

View 3 Replies View Related

General :: How To Unlimited Bash/shell History

May 4, 2010

Is there a way to define an unlimited history in Bash ?

View 3 Replies View Related

General :: Get Bash History From Another Shell Instance

Aug 18, 2010

Possible Duplicate: Can history files be unified in bash? I have bash running in an ssh session, call this session A. I leave the office, go home, ssh to the same box, call this session B. From session B, I'd like to be able to look at the history of session A.

View 1 Replies View Related

General :: How To Get Bash Shell History Range

Oct 4, 2010

How can I get/filter history entries in a specific range?I have a large history file and frequently usehistory | grep somecommandNow, my memory is pretty bad and I also want to see what else I did around the time I entered the command.For now I do this:get match, say 4992 somecommand, then I do history | grep 49[0-9][0-9]this is usually good enough, but I would much rather do it more precisely, that is see commands from 4972 to 5012, that is 20 commands before and 20 after. I am wondering if there is an easier way? I suspect, a custom script is in order, but perhaps someone else has done something similar before.

View 2 Replies View Related

General :: How To Minimize Bash Shell Prompt

Oct 26, 2010

Currently the terminal prompt looks like this:[karlis@karlis-desktop current_folder]$How can I minimize the prompt, so that it only shows $ or # without extra info in square brackets?I checked the preferences for the default Gnome-Terminal and Terminator - there are no settings for this. It is pretty hard to use terminal when working in directories with long names.

View 1 Replies View Related

General :: Bash Shell Script With Menu?

Apr 12, 2011

I've written a bash shell script (code provided below) that gives the user 4 options. However I'm having a little trouble with the code. Right now when they select option 3, to show the date.It loops over and over again.I have to close the terminal window to stop it because it's an infinite loop. How would I prevent this? Also quit doesn't seem to be working either.

#!/bin/bashe
echo -n "Name please? "
read name
echo "Menu for $name[code]............

View 2 Replies View Related

General :: Bash - Get ' Quote ` Back-tic Through The Shell Into Sed?

Aug 3, 2011

In linux how do I to get the ascii decimal/hex/oct code from a char or a ascii char from a decimal/hex/oct code. I see from the gnu sed user manual that I can use the d# o# x# to specify a character but I am not sure how to use that. If some one has a better way to get the the ` and ' chars through I want to sed with the backtick '`' character and ''' single quote character.

sed '/`/p'

these don't work

sed '/'/p'
sed '/`/p'

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved