Sponsored Content
Top Forums Shell Programming and Scripting Odd Behaviour for Set and IFS variable Post 302952559 by Don Cragun on Wednesday 19th of August 2015 08:30:09 PM
Old 08-19-2015
Please show us your entire script, the command line(s) you're using to invoke it, and the output you're getting (all using CODE tags). I would guess that quoting is causing you problems, but without seeing exactly what you're doing, I'm only guessing.
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

IFS changing the variable value

Hi, I have a while read loop that reads files in a directory and process. The files have spaces in between, so I have the IFS=\n to to read the whole line as one file name. The read works fine but I have a problem with another variable that I set in the beginning of the script. The variable... (1 Reply)
Discussion started by: pvar
1 Replies

2. UNIX for Dummies Questions & Answers

the IFS variable

Hi all, Ok os heres my situation. I have created a database style program that stores a persons info (name,address,phone number etc.) in a file ("database"). after i read in all the values above, i assign them to a line variable: line="$name^$address^$phonenum" >> phonebuk as you can see... (1 Reply)
Discussion started by: djt0506
1 Replies

3. UNIX for Dummies Questions & Answers

IFS variable

How can I set the value for IFS variable (2 Replies)
Discussion started by: mahabunta
2 Replies

4. Shell Programming and Scripting

odd behaviour with quoted input strings

I'm working with a java-based monitoring tool (Solaris/x86) which can be configured to call a shell script when a particular event occurs. The java app sends a set of quoted strings as input to the shell script. The problem I'm running into is that the shell script, when called by the java app,... (0 Replies)
Discussion started by: iron_horse
0 Replies

5. Shell Programming and Scripting

Confusion about IFS Variable

================================================= #!/bin/sh HOST=eux091 if && grep -q $HOST /etc/maestab then IFS=: grep -v -e "^#" -e "^$" /etc/maestab | grep $HOST | \ read HOST MAESTRO_BIN FLAG MAESTRO_USER echo $MAESTRO_BIN MAESTRO_HOME=`dirname $MAESTRO_BIN`... (7 Replies)
Discussion started by: Awadhesh
7 Replies

6. Shell Programming and Scripting

resetting IFS variable

Hi, I have modified the IFS variable in the K shell program and with in the program i want to reset to the default one. How do i reset the same. e.g in the begining of the program IFS is default in the middle i changed it to IFS="|" and again i want the default value for the IFS. ... (2 Replies)
Discussion started by: vijaykrc
2 Replies

7. Shell Programming and Scripting

How to set IFS for a specific command

Hi there, I'm using two commands that need different IFS. The mysql command need IFS to include space because I'm given the mysql command as a variable: supernova:~# cat myscript IFS=' ' MYSQL="mysql -u user -ppassword database" $MYSQL -Ne "SELECT COUNT(1), MAX(id), MAX(name) FROM terminal"... (7 Replies)
Discussion started by: chebarbudo
7 Replies

8. Solaris

odd behaviour of app writes to mirrored volumes

Hi, Normally, I setup my volumes under Solaris (doesnt matter, 8 or 10), as vxassist -g dg01 -U gen make vol01 500m dg0101, then I do a mirror vxassist -g dg01 mirror vol01 dg0102. Which is legal and does work, however, when the primary dg01 array (or simply in this case, the volume)... (2 Replies)
Discussion started by: mrmurdock
2 Replies

9. UNIX for Dummies Questions & Answers

How to Separate Odd and Even number from one data set?

Hi, If I want to separate data set to new file by odd and even number. If data set like this 1 ABC 235 hgf 2 DEF 326 kjk 3 XXX 133 kwd 4 YYY 188 fgh If I want separate by colum3 I want result like set 1 1 ABC 235 hgf 3 XXX 133 kwd put to new... (3 Replies)
Discussion started by: GeodusT
3 Replies

10. Shell Programming and Scripting

Odd behaviour with Expect password update script

Hi there. I've been forced by circumstance to write an expect script to handle password updates on a number of servers. There's a mix of Solaris 8, 9, 10, RedHat and Ubuntu. There's no chance the client will allow us to hook them up to a directory, so we have to make do. This script is mostly... (0 Replies)
Discussion started by: whetu
0 Replies
ENVSTORE(1)						    BSD General Commands Manual 					       ENVSTORE(1)

NAME
envstore -- save and restore environment variables SYNOPSIS
envstore command [args ...] DESCRIPTION
envstore can save and restore environment variables, thus transferring them between different shells. command must be one of clear Forget all stored variables eval Produce shell code for evaluation, restoring all saved variables list List saved variables in better readable format save variable [value] Save variable either with its current shell value or with value rm variable Remove variable from store Note: Only the first character of command is checked, so envstore e instead of envstore eval, envstore c for envstore clear, etc., are also valid. ENVIRONMENT
ENVSTORE_FILE The file in which the environment parameters are stored, /tmp/envstore-EUID by default, LIMITATIONS
Variable names or values must not contain null bytes or newlines. Due to limitations imposed by most shells, it is not possible to save parameters containing more than one consecutive whitespace. envstore will save and display them correctly, but unless you do IFS trickery, your shell will not be able to load them. The current maximum length (in bytes) is 255 bytes for the variable name and 1023 bytes for its content. AUTHOR
envstore was written by Daniel Friesel <derf@derf.homelinux.org>. Original idea and script by Maximilian Gass <mxey@ghosthacking.net>. SEE ALSO
envify(1) BSD
December 1, 2009 BSD
All times are GMT -4. The time now is 10:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy