Results 1 to 3 of 3
Hi,
I am trying to get the length of a file into a variable.
In the script I am using:
export FLEN= `wc -m ${SOURCE_FILE} | cut -c1-2 `
echo ...
- 09-21-2011 #1Just Joined!
- Join Date
- Sep 2011
- Posts
- 2
exporting the result of a command in text
Hi,
I am trying to get the length of a file into a variable.
In the script I am using:
export FLEN= `wc -m ${SOURCE_FILE} | cut -c1-2 `
echo ${FLEN}
the result is:
export: `59': not a valid identifier
I want FLEN to = 59 in this case. How do I get redi of ` and ' in the above?
Regards
- 09-21-2011 #2Linux Guru
- Join Date
- May 2011
- Posts
- 1,838
try removing the space directly after the = sign, e.g.:
Code:export FLEN=`wc -m $SOURCE_FILE | cut -c1-2 `
- 09-21-2011 #3Just Joined!
- Join Date
- Sep 2011
- Posts
- 2
Thanks atreyu - that worked


Reply With Quote