10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to be able to use a sed command as a variable in a bash script. I have the sed command that almost works the way I want it. the command is
sed -n '/inet/,/}/p' config.boot
This gets me this result:
inet 192.168.1.245
}
I need to get the IP address into a variable so I... (9 Replies)
Discussion started by: edlentz
9 Replies
2. Shell Programming and Scripting
while i've used arrays to work with variables, i've never used them to loop through a set of strings and wanted to ask the community for some feedback or assistance.
let me be specific. here's my code:
# URL port Variables
port2195=`nc -z $url2195 2195`
port2196=`nc -z $url2196 2196`... (5 Replies)
Discussion started by: hungryd
5 Replies
3. UNIX for Dummies Questions & Answers
I'm reading about debugging aids in bash and have come across the set command. It says in my little book that an addition to typing
set
you can also use them "on the command line when running a script..." and it lists this in a small table:
set -o option Command Line... (5 Replies)
Discussion started by: Straitsfan
5 Replies
4. Shell Programming and Scripting
Hi, wondering if it's been asked before but didn't find matches from google. Basically I have this line:
myvar=$(echo -e "a\tb")
Now somehow the '\t' from the echo output gets replaced with white space and then stored in $myvar.
It creates a problem for me later to use tab as delimiter to do... (2 Replies)
Discussion started by: birddie
2 Replies
5. Shell Programming and Scripting
Hi!
Been working on a script and I've been having a problem. I've finally narrowed it down to this variable I'm setting:
servername=$(awk -v FS=\/ '{ print $7 } blah.txt | sed 's\/./-/g' | awk -v FS=\- '{print $1}')"
This will essentially pare down a line like this:
... (7 Replies)
Discussion started by: creativedynamo
7 Replies
6. HP-UX
Hi,
I am using hp unix
i want to know the use of the following commands
set --
set - variable
thanks (4 Replies)
Discussion started by: gomathi
4 Replies
7. Shell Programming and Scripting
Apologies for the utter triviality of this question, but we all have to start somewhere! I've also tried searching but this question is pretty vague so I didn't (a) really know what to search for or (b) get many relevant hits to what I did search for.
Anyway, I'm in the process of self-teaching... (1 Reply)
Discussion started by: u5j84
1 Replies
8. Shell Programming and Scripting
Hello guys.
In my script, i have the following code:
echo "The tarfile contains these directorys"
tar -tf file.tar > tarlist.txt
cat tarlist | awk -F/ '{print $1 "/" $2}' | nl
echo "Enter path of the directory you want to extract or just press enter to extract everything: "
read path... (1 Reply)
Discussion started by: noratx
1 Replies
9. Shell Programming and Scripting
Hi all,
I want to set a variable in ksh shell (prompt) and echo the value.
$ set x=5
$echo $x
But it is returning null. Can any one please help.
Thanks in advance (1 Reply)
Discussion started by: ammu
1 Replies
10. UNIX for Dummies Questions & Answers
I'm having an issue when I export within my program. I'm getting the variable name, not the variable value. I have a configuration file (config.txt) that has the values of the variables set as so:
set -a
export ARCHIVEPOSourceDir="/interfaces/po/log /interfaces/po/data"
export... (2 Replies)
Discussion started by: ParNone
2 Replies