HI,
Thanks for getting back so quickly -- was at work -- so tried it just now.
I am getting the following error:
I want the time to be the time that the file was created -- I guess this will show the time of executing the script -- am I correct -- if so -- how do we do that?
Thanks
Last edited by Scott; 08-15-2011 at 03:55 PM..
Reason: Code tags
I'm sure this is an easy one but I can't seem to get it working. Given the following:
for oldName in `ls *.JPG` ;do
newName=<confusion here. how to make sed perform 's/.JPG/_thumb.JPG/g' operation on $oldName>
done
Could someone show me what I'm doing wrong?
Thanks
Ken (1 Reply)
I'm trying to figure out how to basically replace a line in a text file using Sed. Here's what I need sed to do:
I have a file with passwords that are in use. Each month the passwords need to be swapped out with passwords stored in another file. I want to use Sed (or Awk ... or possibly both)... (3 Replies)
Hello,
I have a text file in below format, how do I put a header and assign field names to the file with either AWK or SED
STRT~ VA ~23606 ~TM14~8506~1485 (page 1)
STRT~ VA ~23662 ~TM17~8362~1783 (page 2)
STRT~ VA ~23662 ~TM17~8362~1783
STRT~ VA ~23662 ~TM17~8362~1783
STRT~ VA ~23662... (1 Reply)
Hello... I wanted to figure out how to remove the 1st instance of a comma from a file..
100+ line file
-------------
'test1'
,'dudes are cool' <-- remove comma from first instance of comma in file
,'cool dude'
,'bbbbbb'
I tried everything from
cat jigar|tr , >1.txt to cat jigar|sed... (2 Replies)
Hello everyone,
Just started UNIX today! In our school we use solaris. I just want to know how do I setup Solaris 10 not the GUI one, the one where you have to type the commands like ECHO, ls, pwd, etc... I have windows xp and I also have vmware.
I hope I am not missing anything! :p (4 Replies)
Hello everyone,
I am having to do a lot of perl scripting these days and I am learning a lot.
I have this problem
I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files..
there is folder1\folder2\*.gz
and there are about 50 folders... (1 Reply)
Hi,
I am new to programming and also to perl..But i know 'perl' can come to my rescue, But I am stuck at many places and need help..any small help is much appreciated... below is the description of what i intend to acheive with my script.
I have a files named in this format... (13 Replies)
Hello everyone
I could really need some help. I want to rename : with dot. But the problem is that i don't want to touch the hours like 12:00 but i want to change AD:FG with AD.FG. I'm thinking something like : to .
I don't know if i explain it corrrectly but i could use some help
Thanks... (20 Replies)
Howdy folks,
I'm trying to craft a log file summarisation tool for an application that creates a lot of duplicate entries with only a different suffix to indicate point of execution. I thought I'd gotten close but I'm clearly missing something.
Here's a genericized version:
A text_file... (3 Replies)
hi all:
i am trying to use sed to separate hex bytes "363834574e292c20" to "36 38 34 57 4e 29 2c 20". i used the following script (googled) and i got "3 63 83 45 74 e2 92 c2 0".
how could i modify the script to meet my needs?
thanks (8 Replies)
Discussion started by: ipfreak
8 Replies
LEARN ABOUT DEBIAN
shtool-subst
SHTOOL-SUBST.TMP(1) GNU Portable Shell Tool SHTOOL-SUBST.TMP(1)NAME
shtool-subst - GNU shtool sed(1) substitution operations
SYNOPSIS
shtool subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup ext]
[-e|--exec cmd] [-f|--file cmd-file] [file] [file ...]
DESCRIPTION
This command applies one or more sed(1) substitution operations to stdin or any number of files.
OPTIONS
The following command line options are available.
-v, --verbose
Display some processing information.
-t, --trace
Enable the output of the essential shell commands which are executed.
-n, --nop
No operation mode. Actual execution of the essential shell commands which would be executed is suppressed.
-w, --warning
Show warning on substitution operation resulting in no content change on every file. The default is to show a warning on substitution
operations resulted in no content change on all files.
-q, --quiet
Suppress warning on substitution operation resulting in no content change.
-s, --stealth
Stealth operation. Preserve timestamp on file.
-i, --interactive
Enter interactive mode where the user has to approve each operation.
-b, --backup ext
Preserve backup of original file using file name extension ext. Default is to overwrite the original file.
-e, --exec cmd
Specify sed(1) command directly.
-f, --file cmd-file
Read sed(1) command from file.
EXAMPLE
# shell script
shtool subst -i -e 's;(c) ([0-9]*)-2000;(c) 1-2001;' *.[ch]
# RPM spec-file
%install
shtool subst -v -n
-e 's;^(prefix=).*;1 $RPM_BUILD_ROOT%{_prefix};g'
-e 's;^(sysconfdir=).*;1 $RPM_BUILD_ROOT%{_prefix}/etc;g'
`find . -name Makefile -print`
make install
HISTORY
The GNU shtool subst command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 2001 for GNU shtool. It was prompted
by the need to have a uniform and convenient patching frontend to sed(1) operations in the OpenPKG package specifications.
SEE ALSO shtool(1), sed(1).
18-Jul-2008 shtool 2.0.8 SHTOOL-SUBST.TMP(1)