I'm using the linux 'script' command http://www.linuxcommand.org/man_pages/script1.html to log all input and output in an interactive bash script.
At the moment I have to call the script command, then run my bash script, then exit.
I want to run the script and exit commands from within the actual bash script itself.
I have a bash script I'm using to connect to a remote server via ssh. That works, however I want the script to immediately pass the command of cd /some/dir after connecting. That doesn't seem to be working.
Hello All,
I am writing an Expect Script to execute some commands over ssh then exit the script.
The script works just fine if I automate everything and assuming the correct password was entered.
So this Expect Script gets executed from a Bash script...
CentOS 5.x
I'm trying to build a shell script that searches data provided via stdin.
When, in my terminal, I type
cat ~/my/+(a|b)/doc
It reads ok from both ~/my/a/doc and ~/my/b/doc, but when I put that command in a bash script:
#!/bin/bash
cat ~/my/'+(a|b)'/doc
I get the error:
cat: ~/my/+(a|b)/doc: No such file or directory
Is it not possible to use extended globbing inside a bash script?
Hey guys,
I want to paste a code in a .php file via a bash script.
How may I know if a script is either written in bash or sh?
The first line of the script mean nothing, since on Linux, bash script has this line:
#!bin/sh
Actually, there are many distribution where bin/sh is bash (maybe a bin/sh is a link to bin/bash in those distro), and not bourn shell.
My target is to create the /var/tmp/add_user.bash script by /var/tmp/create_script_add_user.bash script
and run the expect script ( add_user.bash ) from create_script_add_user.bash script.
The problem is that when I run the script add_user.bash from create_script_add_user.bash, then expect stuck on the question:
Proceed?
Just a quick script to reverse some input, using Bash and the FOSS "rev" program. It's amazing how easy it is to manipulate things with Bash. I love it!#!/bin/bash #Simple script to reverse an input nameecho "Enter your name";read 'myname' echo "Your name spelled backwards is: $( echo $myname | rev )" exit 0 That's all there is to it!Amazing eh?