Search Results

Search: Posts Made By: jahndavik
16,620
Posted By sayami00
Try this one also :- cur_dir=`pwd` for...
Try this one also :-
cur_dir=`pwd`
for loop_dir in `ls -altr | awk '{if($9!="." && $9!=".." && $9!="")print $9}'`
do
cd $cur_dir
if [ -d $loop_dir ] ; then
cd $cur_dir/$loop_dir
for...
16,620
Posted By SriniShoo
for i in /home/user/ABCD/* do ...
for i in /home/user/ABCD/*
do
FNAME=$(basename ${i})
FPATH=$(dirname ${i})
DNAME=${basename ${FNAME})
mv ${i} ${FPATH}/${DNAME}.${FNAME}
done
16,620
Posted By chacko193
Try: for file in /path/to/your/directory/* ...
Try:

for file in /path/to/your/directory/*
do
fname=${file##*/} #This gives your base filename.
fpath=${file%/*} # Your dir
dname=${fpath##*/}
mv $file ${fpath}/${dname}.${fname}
done
3,331
Posted By michaelrozar17
I didn't understand completely, can you try...
I didn't understand completely, can you try replacing those ? with . (period) if echo "$z" | grep -q "R1......R1";
Showing results 1 to 4 of 4

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