Hi all, i have more questions but its all about variables so lets begin
1st, is possible to list all variables ?
Command env display only shell variables, but what if i declared another variable? Command set display more variables but not defined by me.
2nd, what difference is between set and env ?
3rd, lets say i declared variable which contains whitespaces, or i have variable which contains whitespaces for example IFS. When i type echo $IFS i see nothing, so i dont know if is declared or if contain white spaces.
Is possible to write white spaces in C format (\n \r \t ...) ?
4th what is difference between sourcing and exporting variable ?
PS: i saw declaration of IFS in set command (IFS=$' \t\n')
1. "set" lists all variables. Double check, your variable must be there.
Try this:
2. "env" list all environment variables.
3. For variable with space use quotes.
4. For $IFS do the same as before:
Oh its not my day for syntax...
cat gzipsize.txt | awk '{print "echo",$1,$2} > master.txt
I have read a lot about the awk -v but haven't been able to get it to work. I have a variable in my script and I'm looking just to push it into the awk after the $2 (or anywhere would do)!!!
Every... (11 Replies)
hi, i'm new in shell scripting and i'm working on bash on solaris 5.9
after try many stuff with unexpected results, i wonder:
it is not posible in bash, to use a variable that was created inside a loop, out of it?
i mean, for instance:
cat mytext | \
while read text
do
viko=$text... (2 Replies)
Discussion started by: viko
2 Replies
3. Post Here to Contact Site Administrators and Moderators
Where can I download the VTC - Unix Shell Scripting Advanced complete video.
I don't know in which thread I should post this question.Plz help me out, or just tell me the link in the reply to this post.
Thanks in advance. (0 Replies)
Would appreciate if someone can explain the ${0##*/} line. What does it do?
I am aware that $0 is the script name, $# is number of arguments passed in, $* is all the arguments. With the curly brackets {} added in, what's the eventual effect?
Does ${0##*/} actually equals $0$#$*? (something like... (3 Replies)
Hi all
I've got a question regarding error handling in shell scripts. My background is mainly object oriented programming languages, but for a year or so I've been doing more and more (bash) shell scripting (which I quite enjoy by the way).
To handle errors in my scripts I... (3 Replies)
I am not an expert of shell scripting, but I can do some simple things. Now, I read a script written by others and I need some help from the experts of this forum.
Please help me to understand what is going on in this cycle:
if ; then
] && \
export... (25 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am working on a hands on project. We are creating a script for a corporate phone list. The project I am... (2 Replies)
Hi,
How could we take the value of awk variables out to shell?
I know the following methods
1. awk '{print $1}' < file | read a
echo $a
2. a=`awk '{print $1}' < file`
echo $a
Please let me know if there are any other methods.
Also, how do we take more than 1 variable value... (4 Replies)
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies
LEARN ABOUT SUSE
tcp-env
tcp-env(1) General Commands Manual tcp-env(1)NAME
tcp-env - set up TCP-related environment variables
SYNOPSIS
tcp-env [ -rR ] [ -ttimeout ] program [ arg ... ]
DESCRIPTION
The input for tcp-env must be a TCP connection. tcp-env finds out information about that connection, puts the information into several
environment variables as described in tcp-environ(5), and runs program with the given arguments.
Usually tcp-env is run from inetd. It might instead be run from another server that already sets up the right environment variables; if
PROTO is set to TCP when tcp-env is invoked, tcp-env assumes that all the other variables are set up properly, and it does not check
whether the input is a TCP connection.
OPTIONS -r (Default.) Attempt to obtain TCPREMOTEINFO from the remote host.
-R Do not attempt to obtain TCPREMOTEINFO from the remote host.
-ttimeout
Give up on the TCPREMOTEINFO connection attempt after timeout seconds. Default: 30.
SEE ALSO tcp-environ(5), inetd(8)tcp-env(1)