#echo $LINE |cut -f"${arg}" -d' '
pom=$LINE |cut -f"${arg}" -d' '
I have this two lane. First is working but second not. I want to variable get a value of this command cuz i want use this value like string.
You need to run the first line, then assign the value returned to the variable. You do this with the command inside backticks, like this:
pom=`echo $LINE |cut -f"${arg}" -d' '`
The reason the second line doesn't work, is because whats in $LINE is most probably not a valid command, and pipes takes outputs from commands, which is why you need echo to output the contents of $LINE.
This kind of code is discouraged :
pom=`echo $LINE |cut -f"${arg}" -d' '`
in favor of :
pom=$(echo "$LINE" | cut -f"${arg}" -d' ')
The backquote () is used in the old-style command substitution, e.g. foo=command`. The foo=$(command) syntax is recommended instead. Backslash handling inside $() is less surprising, and $() is easier to nest. See http://mywiki.wooledge.org/BashFAQ/082