Sponsored Content
Full Discussion: Trouble saving variable
Top Forums Shell Programming and Scripting Trouble saving variable Post 302375213 by danietepa on Friday 27th of November 2009 02:38:36 AM
Old 11-27-2009
Trouble saving variable

Hi,
I have problems when you save a variable of a command. I have put the following line:

CONEXION_BAGDAD = $ (grep-c "Please login with USER and PASS" $ LOG_FILE_BAGDAD)

But I returned the following error:
syntax error at line 67: `CONEXION_BAGDAD = $ 'unexpected

Because it can happen?

Thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Saving output from awk into a perl variable

How would I pass awk output to a perl variable? For example, I want to save the value in the 4th column into the variable called test. My best guess is something as follow, but I am sure this isn't correct. $test = system("awk '/NUMBER/{print \$4}' $_"); (8 Replies)
Discussion started by: userix
8 Replies

2. Shell Programming and Scripting

saving awk value in a bash array variable

hi all i am trying to save an awk value into an array in bash: total=`awk '{sum+=$3} END {print sum}' "$count".txt"` ((count++)) the above statement is in a while loop.. $count is to keep track of file numbers (1.txt,2.txt,3.txt,etc.) i get the following error: ./lines1:... (1 Reply)
Discussion started by: npatwardhan
1 Replies

3. UNIX for Dummies Questions & Answers

saving command output to a variable

Hello, I have a shell script containing a command string in the following format: command1 | command2 | cut -c9-16 The output from this is a record number (using characters 9-16 of the original output string) e.g. ORD-1234 I wish to save this value to a variable for use in later commands... (4 Replies)
Discussion started by: philjo
4 Replies

4. Shell Programming and Scripting

Help with capturing homedir via ssh and saving to variable

I need to capture the homedir using the ssh command and then saving it to a variable. The results from the following command is what I need to capture to a variable: NOTE: the value I'm getting back is also incorrect. as it seems to be getting the home dir from the local server and not the... (2 Replies)
Discussion started by: reneuend
2 Replies

5. Shell Programming and Scripting

shell script for saving oracle database records in variable

i want to retrieve value in each column of each row in sql plus and save them into array variable and echo the value in array variable (2 Replies)
Discussion started by: ramish
2 Replies

6. Shell Programming and Scripting

Having trouble greping a variable

I'm trying to take a users input, and then such a text file to see if it contains it. I get an error when running it: "./Login.sh: Line 8: echo Username read username if ; then echo Login successful. else echo Failed to login. fi If someone could give me some input to where I'm... (4 Replies)
Discussion started by: Hegarz
4 Replies

7. Shell Programming and Scripting

Non trivial file splitting, saving with variable filename

Hello, Although I have found similar questions, I could not find advice that could help with our problem. The issue: We have a few thousands text files (books). Each book has many chapters. Each chapter is identified by a cite-key. We need to split each of those book files by... (4 Replies)
Discussion started by: samask
4 Replies

8. Shell Programming and Scripting

Unwanted execution instead of saving to environment variable

My .bash_profile file: source $HOME/build.variables My build.variables file: export threads="$(${threads:-$(lscpu | egrep "CPU\(s\):|Thread" | $]\)\n. *Thread.*\(]\)@\1*\2@;Ta")])})"threads=$(lscpu | egrep "CPU\(s\):|Thread" | $]\)\n.*Thread.*\(]\)@\1*\2@;Ta")The above codes when not comment out... (7 Replies)
Discussion started by: charlieandlinux
7 Replies

9. Shell Programming and Scripting

awk - saving results of external script to variable.

So, I've been playing with speeding up some analysis we do by using multiple threads of awk (actually, mawk, but code-compatible as far as I use it) on multiple CPU cores. So, I have a big data file and I have several copies of exactly the same processor script, written in mawk. I also have a... (8 Replies)
Discussion started by: treesloth
8 Replies

10. Shell Programming and Scripting

Saving Mod in a variable

Hello Experts, In one of my shell script, I've been trying to calculate mod and saving it in a variable, below is what I have tried but it isn't working. Any help appreciated!!! #!/bin/bash num1=4 num2=3 echo "Number one is $num1" echo "Number two is $num2" mod_final=$(( echo "num1%num2"... (7 Replies)
Discussion started by: mukulverma2408
7 Replies
CHSH(1)                                                            User Commands                                                           CHSH(1)

NAME
chsh - change login shell SYNOPSIS
chsh [options] [LOGIN] DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account. OPTIONS
The options which apply to the chsh command are: -h, --help Display help message and exit. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -s, --shell SHELL The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks. NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. FILES
/etc/passwd User account information. /etc/shells List of valid login shells. /etc/login.defs Shadow password suite configuration. SEE ALSO
chfn(1), login.defs(5), passwd(5). shadow-utils 4.5 01/25/2018 CHSH(1)
All times are GMT -4. The time now is 02:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy