10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi
i want to replace date stamp filename to original file name. i want to remove the datestamp after .txt For eg:
file_name.txt_01-1002014
output:
file_name.txt
tried with below one but not able to achieve
mv file_name.txt_01-1002014`basename "file_name.txt_01-1002014 "`.txt (4 Replies)
Discussion started by: rohit_shinez
4 Replies
2. Shell Programming and Scripting
HI
owner date and time and size of file in a row
shell script to list filename file_path i have tried the below code
present_dir=`pwd`
dir=`dirname $0`
list=`ls -lrt | awk {'print $9,$3,$6,$7,$8'}`
size=`du -h`
path=`cd $dir;pwd;`
printf "$list"
printf "$path"
printf " $size"
... (4 Replies)
Discussion started by: abiram
4 Replies
3. Shell Programming and Scripting
Hi all,
I'm trying to replace a pattern/string in about 100 files with the filename using following commands but getting nowhere:
for f in *.fa; do sed "s/^>.*/>$f/g" $f > $f_v1.fa; done
for f in *.fa; do sed 's/^>.*/>`echo $f`/' > $fa_v1.fa; done
Basically I want to change any line... (5 Replies)
Discussion started by: ivpz
5 Replies
4. Shell Programming and Scripting
i'm looking for a way to enable and disable repositories from a script.
i started with a sed command like this:
sed '/*'"$REPO"'/,/'"$STOP"'/ s/^*//' /etc/apt/sources.list
but this enables both the normal and the source repos.
for example:
# deb http://www.lamaresh.net/apt lenny main
#... (7 Replies)
Discussion started by: Leppie
7 Replies
5. Shell Programming and Scripting
hi everyone,
can someone suggest how i can list the contents of a directory and display their corresponding last modify time in the format yyyymmddhhmm?
thanks in advance! (16 Replies)
Discussion started by: Deanne
16 Replies
6. Shell Programming and Scripting
Hi,
I have a few thousand files, each contains the word "hello". Would it be possible to do a batch job that replaces the word hello with the filename?
Thanks. (2 Replies)
Discussion started by: calrog
2 Replies
7. UNIX for Dummies Questions & Answers
I tried searching for this, but I might have used the wrong terms as I couldn't find answers to this question.
I'm looking for a way to replace all files with a certain filename with another file within a specific directory including all of it's subdirectory using a shell-script. (2 Replies)
Discussion started by: Schmellsera
2 Replies
8. Shell Programming and Scripting
I am posting a script below which essentially excutes the following functions in the described order.
1) From a source directory pools together three files generated by system logs for each user session, tar's these files and archives them as a log set in a destination directory and these... (0 Replies)
Discussion started by: Sammy
0 Replies
9. Shell Programming and Scripting
how can i read a part of filename from the list in the script?
all file in directory...will start with "CDBACKUPFILE" then the name is stored in list.txt such as JOHN,MARRY,PETER. After this, is seq number.
CDBACKUPFILEJOHN00001
CDBACKUPFILEMARRY00004
CDBACKUPFILEPETER00003
I will use:... (3 Replies)
Discussion started by: happyv
3 Replies
10. Shell Programming and Scripting
Hi All,
I have a script to convert a file and output the filename with "_output", however it not work. Can help?
echo Please input list file name:
read listn
for file in `cat $listn.txt`
do
convert $file > $file_output
Thanks all!! (3 Replies)
Discussion started by: happyv
3 Replies