If you're using sed to get rid of the minus signs, the date string must be in a file. Try:
Note that you don't need to save and restore the value of IFS if you just set its value to be other than the default only for the call to read.
These 2 Users Gave Thanks to Don Cragun For This Post:
Another newbie to Unix scripting Q..
How do you assign a value resulting from a command, such as awk, to a variable.
I am currently trying:-
$awk '{print $1}' file1 > variable1
with no change to $variable1.
The line:
$awk '{print $1}' file1
does print the first line of the... (3 Replies)
Hi
In my shell script, I'm trying to find the line count of a file and assign it to a variable.
LINE_COUNT=$(wc -l $FILE_NAME)
But when i display LINE_COUNT, i'm getting the linecount concatenated with the file name. I want only the number. How can i get the line count alone ? Someone... (2 Replies)
hi all,
in ksh, how do i assign the output of a find command to a variable, e.g
am trying something like this :
totalNoFiles=$(print find ./ -name "SystemOut*.log");
but when i echo $totalNoFiles it displays
find ./ -name "SystemOut*.log"
instead of the total number of... (2 Replies)
can we make a global variable and store character values and add other values to that variable ?? for example
a="hello, John"
and can we add value ". How are you? so
a can have
"hello, John. How are you?"
can someone help me?? (2 Replies)
Hi folks.
I have this variable called FirstIN that contains something like this: 001,002,003,004...
I am trying to assign the content of this variable into ModifiedIN but with the following format : 001 002 003 004...(changing the commas for spaces)
I thought about using sed but i am not... (17 Replies)
my script is some thing like this
i11="{1,2,3,4,5,6,7,8,9,10,11,}"
echo "enter value"
read value ..............suppose i11
x="$value"
echo "$($value)" .............the echo should be {1,2,3,4,5,6,7,8,9,10,11,}
but its showing "i11" only.
plz help me out to get desired... (10 Replies)
Hi,
I have a list of files in a directory. Each file has a .txt and a .log extension i.e. file.txt & file.log, file1.txt & file1.log etc. The file with the .log extension may not always exist alongside the file with the .txt extension.
I need to copy the .txt file if there is a corresponding... (6 Replies)
Unable to get the value to a variable.
set -x
cd $HOME
echo "Enter the server name"
read a
echo $a
i=4
j=1
k = ps -ef | awk '/server1/{ print $4 }' | tail -$i | head -$j`
echo $k
When I do the same in command line it works, however the same does not work when I provide that in the... (1 Reply)
I have a date column as 06302015 but I need to have variable which extracts 063015.
Am trying something like below but it is not assigning
Please let me know if am missing something. Thanks in advance.
################################
#!/usr/bin/ksh
DT=06302015
... (7 Replies)
Discussion started by: weknowd
7 Replies
LEARN ABOUT DEBIAN
envstore
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