10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
when i do something like this:
bona=$(echo hi2 > /dev/pts/1 ; printf '%s\n' "" | sed '/^$/d')
i get:
hi2
and the $bona variable is empty, when I run:
echo ${bona}
i get the result "hi2" outside of the variable. I want it stored in the bona variable with nothing outputted to the... (6 Replies)
Discussion started by: SkySmart
6 Replies
2. Shell Programming and Scripting
the value of the variable is
yes
group=bsp_16
keyword="82599"
test_var="-a xxx -b yyy"
I want to get output with
-a xxx -b yyy (0 Replies)
Discussion started by: yanglei_fage
0 Replies
3. Shell Programming and Scripting
Hi everybody,
I am trying to do the thing you see in the title, and I can't simply do
a=$(svn up)
echo $a
because the program (svn) gives output on lots of lines and in the variable the output is stored on only one line (resulting in a horribly formatted text). Any tips?
Thanks,... (2 Replies)
Discussion started by: ocirne94
2 Replies
4. Shell Programming and Scripting
The situation is like this:
I am reading records from a file, depending upon some condition extracting fields from the file into different variables in a loop one by one. I need to print all the variable in line, so I am trying to redirect hose variables one by one to a variable called final_value... (1 Reply)
Discussion started by: mady135
1 Replies
5. Shell Programming and Scripting
As part of an expect script, I have to convert a strange user ID to a conventional UNIX ID. To do this, I read the contents of a file and do a little awk magic. Here's that bit of the expect script:
send "awk 'NF == 10 && \$NF == strange_user_id {print \$(NF-2)}' file_with_my_info\r"
expect... (0 Replies)
Discussion started by: treesloth
0 Replies
6. Shell Programming and Scripting
Hi all,
I would like to store the output of a command in a variable and output it to the console at the same time. This is working fine using the following construct
var=`command | tee /dev/tty`
I use this in some scripts to display the output of the command on the console and, at the same... (2 Replies)
Discussion started by: script_man
2 Replies
7. Shell Programming and Scripting
Please tell me how to pass variable "a b c" to expect from the shell script
1/ example of input file
# cat in-file
var1 var2 a b c var4
2/ # this is my script - how to pass "a b c" as single variable ?
cat in-file | while read x
do
my-expect x
done
3/ # expect script - how to... (0 Replies)
Discussion started by: breaktime123
0 Replies
8. Shell Programming and Scripting
Hi There,
I try to transfer a variable from the script to a function which use expect, but I don't succed.
#!/bin/sh
HPPASS1="$2"
send_command()
{
echo "spawn ssh login@10.10.10.10"
echo 'set password '
echo 'sleep 1'
echo 'expect "*assword:*"'... (5 Replies)
Discussion started by: sylvainkalache
5 Replies
9. Shell Programming and Scripting
Hi. I'm a newbie in scripting and i have this problem: i want to use the 'fuser' command on a file to tell if it's being accessed (for my purposes: still being written). I want to save the output of the command and later compare with the 'not being used' result.
the script:
#!/bin/bash... (2 Replies)
Discussion started by: nunovc
2 Replies
10. Shell Programming and Scripting
Hello!
I'm having problems trying to extract the contents of a variable and placing it into a text file. Grateful for any help.
Been trying something along the lines of:
$variable > file.txt
or
`cat < $variable` > file.txt
As you can see I'm a newbie to this :D (2 Replies)
Discussion started by: lloowen
2 Replies