mbpssgms
asked on
printig 20 lines from string
hi I need to write an awk script that prints 20 lines from a string and directs output to a file.
pls help.
pls help.
Can you give an example of the input and desired output?
How does your string store 20 lines?
strings in shell scripts do not have \n or \r or anything like that in tham as far as I know.
If you have managed to get new lines into a string then you could echo it and then pipe it to head and then pipe that into a file
echo "$string" | head -n 20 > /path/file.txt
If you have managed to get new lines into a string then you could echo it and then pipe it to head and then pipe that into a file
echo "$string" | head -n 20 > /path/file.txt
The question needs clarification. At this point all we could do is guess at the i/o.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks I'd been away. This was similar to another solution.