//View Tip #549
Similar Tips
» ESC-g for glob expansion in bash
» Bash fork bomb
» Permanent bash history
» Loop over files with spaces in the name
» Get latest stable version of the Linux kernel

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
The 'read' command can be used to split arguments based on any arbitrary character using IFS:

$ echo 'a/bc/ de fg hi/j' | { IFS='/' read first second others; echo "$first"; echo "$second"; echo "$others"; }
a
bc
 de fg hi/j


View Comments »




Comments 

Add your comment

Comments are currently disabled
No Comments

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit