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...
Hi,
Can you please hint me how to achieve the below?
Input:
$./script.sh start 1 2
Internally inside the script i want to set a single variable with $2 and $3 value?
Output:
CMD=$1
ARGS=$2 $3
--VInodh
Hi,
There is probably a very simple fix, but its wrecking my buzz
I call the following on the command line
R CMD BATCH '--args Y_filename="one.txt" out="two.txt"' brew.R
I want to call this from a bash script but replace one.txt with $1, and two.txt with $2 (ie the first two arguments from the command line)
Hi there.
There is a shell script:
Code:
#!/bin/bash
ARGS=`(grep -i $1 old.txt || grep -i $1 new.txt) |awk 'BEGIN {FS=","}{print "\x27" $5 "\x27"}' | tr "\n" " "`
/usr/bin/expect -- << EXPECTEND
spawn -noecho myssh myhost.localnet
log_user 0
expect root
log_user 1
send "/home/one.pl $ARGS\r"
set val $expect_ou
HI guys i am new to programing world, i have found one more wish with command line argument.
I have a shell script say one.sh ,
file_name=$1 //first argument file name(two.sh)
//connect to ftp and download $file_name
bash $file_name $2 $3 $4 //2nd 3rd and 4th arguments
say $file_name "actual name is two.sh, in two.sh
.....
.....
chmod 777 script.sh
At this moment I have:
#!/bin/bash
screen -p 'ScreenName' -x eval 'stuff '"'"$@"'"'\015'
echo eval 'stuff '"'"$@"'"'\015'
But when I call my script as:
# script.sh asd "asd" 'asd'
my arguments passed as: asd asd asd
and I get output:
eval stuff 'asd asd asd'\015
I except a: asd "asd" 'asd'
How I can change my script to pass whole arguments line with all quotes?
How can I pass an optional argument to a bash script that will replace an existing variable in the script? For example:
#!/bin/bash
#hostfinder.sh
#Find hosts in current /24 network
subnet=$(hostname -i | cut -d.
I am writing a bash script that runs each of its arguments as a command. This works for commands in my PATH, but not for aliases. I can directly call an alias in the script, but I can't call an alias that has been passed as an argument.
The problem (I assume) is that aliases are expanded before variables.
I need to pass an argument from the command line to the "at" command.
I want "at" to run a script which requires a few arguments from the command line when it runs.