Search Results

Search: Posts Made By: cinderella1
5,578
Posted By in2nix4life
Yet another way: for i in *;do awk -F:...
Yet another way:


for i in *;do awk -F: '/ACCOUNT/{system("mv -vv "FILENAME" "FILENAME"."$2)}' $i;done
5,578
Posted By elixir_sinari
One way: cd /path/to/your/dir for i in * do...
One way:
cd /path/to/your/dir
for i in *
do
if [[ -f $i ]]
then
str=$(awk 's=index($0,"ACCOUNT:"){print acct=substr($0,s+8,10);exit(0)}' "$i")
[[ -n $str ]] && echo mv "$i" "$i.$str"
...
5,578
Posted By rdrtx1
try: for file in * do acct=$(grep...
try:
for file in *
do
acct=$(grep "^ACCOUNT:" "$file" | sed 's/^ACCOUNT: *//')
[[ -n "$acct" ]] && mv -f "$file" "$file.$acct"
done
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 01:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy