We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Linux Shell
- Text Processing
- Cut #5
- Discussions
Cut #5
Cut #5
+ 2 comments echo $line | cut -f1-3 echo "$line" | cut -f1-3
Why just the second one works? Which changes the double quotes causes?
+ 2 comments cut -d $'\t' -f1-3 worked for me. -d only takes only one character so cut -d ' ' -f1-3 wouldn't work. also cut -d "\t" -f1-3 wouldn't work.
+ 5 comments #!/usr/bin/env bash IFS="" while read line; do echo -e "$line" | cut -f -3 done
+ 5 comments I think this challenge is broken, the input doesn't seem to be tab seperated. EDIT: Seems to be working now
+ 3 comments This works
#!/bin/bash while read s do echo "$s" | cut -f1-3 done
Load more conversations
Sort 119 Discussions, By:
Please Login in order to post a comment