Search Results

Search: Posts Made By: marios
8,644
Posted By Corona688
A number as far as the shell is concerned, a...
A number as far as the shell is concerned, a number is a string that holds digits. You don't need to "convert" it, something else is going on.

Could you post a sample of your data file?
8,644
Posted By Corona688
Could you attach your data file? The actual...
Could you attach your data file? The actual file, not what you think it looks like. I think it's not what you expect.
8,644
Posted By gary_w
Works for me
#!/bin/sh

file="inputfile.txt"

while IFS='|' read fullname spacename startnumber
do
echo "$fullname $spacename $startnumber"

if [ "$startnumber" -le 9 ];then
echo "startnumber is less...
8,644
Posted By Corona688
Works fine. Keep in mind that any blank line...
Works fine.

Keep in mind that any blank line or record will provoke that error. You might want to put an [ -z "$fullname" ] && continue at the top of your loop to ignore blank lines.

Also...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 07:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy