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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 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 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,686
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
