I tried storing the contents of a file in an environment variable using one of those commands.
a= cut -f 1 abc.txt
cut -f 1 abc.txt >a
neither works .
So , can anybody help me out?
I tried storing the contents of a file in an environment variable using one of those commands.
a= cut -f 1 abc.txt
cut -f 1 abc.txt >a
neither works .
So , can anybody help me out?
a= cut -f 1 abc.txt
This doesn't work, this will assign the word 'command' cut to the variable a. The correct syntax is
a=`cut -f 1 abc.txt`
Now you can run the command
echo $a
and check the result. Works
The second command
cut -f 1 abc.txt >a
This will redirect the output of the command cut -f 1 abc.txt into a newly created file named a and not a variable a.