#!/bin/bash
cat datafile| \
while read line
do
lastword=${line##*,}
echo $lastword
echo $line > $lastword
done
More Related Contents:
- create a file with prefix =file1 followed by the random number
- How to get overall CPU usage (e.g. 57%) on Linux [closed]
- How to merge two files using AWK? [duplicate]
- How to parse a CSV file in Bash?
- How to run script as another user without password?
- cronjob does not execute a script that works fine standalone
- Given two directory trees, how can I find out which files differ by content? [closed]
- bash alias command with both single and double quotes
- Recursively look for files with a specific extension
- Take nth column in a text file
- Add a bash script to path
- Run multiple commands at once in the same terminal
- How to remove non UTF-8 characters from text file
- Uppercasing First Letter of Words Using SED
- how to get MouseMove and MouseClick in bash?
- Get last dirname/filename in a file path argument in Bash
- Bash script execution with and without shebang in Linux and BSD
- Variable in Bash Script that keeps it value from the last time running
- Exit code of variable assignment to command substitution in Bash
- How do I get cURL to not show the progress bar?
- Move all files except one
- Using `date` command to get previous, current and next month
- Linux: remove file extensions for multiple files
- Joining multiple fields in text files on Unix
- Alias with variable in bash [duplicate]
- find a pattern in files and rename them [closed]
- Linux shell script to add leading zeros to file names
- Negate if condition in bash script
- Creating temporary files in bash
- Changing environment variable of a running process