10-06-2007
simple type bash space and the file name
$ bash bar
$ sh bar
$ ./bar
if ur using ./ means ten u hav to change the premission chmod 755
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I want to execute some commands on unix machine from the mac machne. I have two options for doing so, I am confused which is the best way of doing. Here are two options.
Requirement:
Execute command on the remote server machine. Commands to be executed itself contain arguments to be... (0 Replies)
Discussion started by: Ranu
0 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
I am new to unix. Anyone knows how to search a file in bash terminal, please kindly tell me.
For example, I want to search file named "myfile" in the entire machine...
Thanks a lot:) (2 Replies)
Discussion started by: andrewust
2 Replies
3. Shell Programming and Scripting
Hi All,
I am trying to write a simple bash script.
rm -f File1
I saved this as test.sh
Now when I want to execute it, I type ./test.sh
It gives me error "command not found"
What I am doing incorrect here? Do I have to add anything in script like
#!/bin/bash (5 Replies)
Discussion started by: palak08
5 Replies
4. Shell Programming and Scripting
How can I make a bash script that keeps on running after I have closed the terminal?
Or a script that runs without having the terminal window open? (1 Reply)
Discussion started by: locoroco
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
The computer that I use is on a network and has the exact same installation as other computers on the network (Ubuntu 10.04 LTS). When I open a new terminal window by default it opens a tcsh shell. I don't have the root privilege to modify it.
Is it possible to open a terminal window that... (8 Replies)
Discussion started by: gaurab
8 Replies
6. Shell Programming and Scripting
Is it possible to make Linux terminal cursor invisible in bash script? (1 Reply)
Discussion started by: xqwzts
1 Replies
7. Shell Programming and Scripting
I frequently use some commands, which I want to save in some file say myregularshell.shthese are the commands I use, I tried saving and executing, but couldn't get the preview of execution, and result is also not coming if I copy same commands and paste it on terminal result is coming
cd go... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies
8. Shell Programming and Scripting
I need to modify a bash script to to take each line in a file and execute command. I currently have this:
#!/bin/bash if ; then echo "Lipsa IP"; exit; fi i=1 ip=$1 while ; do if ; then rand=`head -$i pass_file | tail -1` user=`echo $rand | awk '{print $1}'` pass=`echo $rand | awk '{print $2}'`... (3 Replies)
Discussion started by: galford
3 Replies
9. Shell Programming and Scripting
Hello All,
I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly.
Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies
10. Shell Programming and Scripting
Hello i am having an issue with bash script and this is the code
now=$(cat hosts1.txt | awk '{print $2;}')
while read n ;do
ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers'
When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies
LEARN ABOUT DEBIAN
alzabo::changetracker
Alzabo::ChangeTracker(3pm) User Contributed Perl Documentation Alzabo::ChangeTracker(3pm)
NAME
Alzabo::ChangeTracker - Saves a set of changes as callbacks that can be backed out if needed
SYNOPSIS
use Alzabo::ChangeTracker;
my $x = 0;
my $y = 1;
sub foo
{
my $tracker = Alzabo::ChangeTracker->new;
$tracker->add( sub { $x = 0; } );
$x = 1;
bar();
eval { something; };
$tracker->backout if $@;
}
sub bar
{
my $tracker = Alzabo::ChangeTracker->new;
$tracker->add( sub { $y = 1; } );
$y = 2;
}
DESCRIPTION
The trick ...
We only want to have one object of this type at any one time. In addition, only the stack frame that created it should be able to clear it
(except through a backout). Why? Here's an example in pseudo-code to help explain it:
sub foo
{
create a tracker;
store some change info in the tracker;
call sub bar;
store some change info in the tracker;
# point Y
clear changes in tracker;
}
sub bar
{
create a tracker; # internally, we really just increment our stack count
store some change info in the tracker;
clear changes in tracker; # point X
}
If at point X we were to really clear out the changes, even the changes just from sub bar, we'd have a problem. Because if at point Y,
things go to hell and we want to back out the changes, we want to back out the changes from sub foo _AND_ sub bar. However, if bar is also
an entry point we want to be able to track changes in bar and clear them from bar.
AUTHOR
Dave Rolsky, <autarch@urth.org>
perl v5.8.8 2007-12-23 Alzabo::ChangeTracker(3pm)