sed returns sed: command garbled
This should work :
sed 's/-.*;/;/g' file > newFile
sed command garbled for solaris
sed -n '#Solaris version
/description/!{
H;d
}
/description/ {
x; /XCJDAST/p
}
$ {
x; /XCJDAST/p
}' tsgroupsPrevious.xml
- after a
d
, sed stop the script even with a;
after, not in linux ;
is a substitute for line separator, not always available in non GNU sed script especially in group of action (and after command liked
)- also, comment must start on first character of a line
Sed command garbled error due to regex
The *
goes after the character class:
[0-9]*
The delimiter should not be a slash.
I think the whole cmd should be:
sed "s~-log -asofdate [0-9]*~-log -asofdate $newAsOfDate~g" /export/home/ownclp/temp/runjava.sh.bk > /export/home/ownclp/temp/runjava.sh
sed command garbled for bash 3.0
sed -n '/\*=/ {n;p;}' ...
you need to terminate the line after the p
so a ;
or a new line. Your code will certainly work on recent GNU sed but not on posix version
sed: command garbled in SunOS
Use:
sed '/<AddName>/{ s/<AddName>/<ModifyName>/;}' ${modified_name_file} > ${RESOURCES}/tempfile2.xml
Sed command garbled with very easy mutiline regex in bash
If you are using a "recent" bash, I think you can use cut and assign extracted values to an array:
numbers="$(cut -d',' -f2 filename.txt)"
array_numbers=( $numbers )
Related Topics
Logrotate to Clean Up Date Stamped Files
Simple Way to Convert Hh:Mm:Ss (Hours:Minutes:Seconds.Split Seconds) to Seconds
How to Parse Netstat Command in Order to Get Process Name and Pid from It
Rsync - Mkstemp Failed: Permission Denied (13)
Genymotion Throws Libssl_Conf.So: Cannot Open Shared Object File: No Such File or Directory
After Changing /Etc/Profile, What Do I Have to Do to Reset My Shell
What Happens If You Mount to a Non-Empty Mount Point with Fuse
Insert New Line to Bash Prompts
How to Configure Bash to Handle Crlf Shell Scripts
Splitting Gzipped Logfiles Without Storing the Ungzipped Splits on Disk
Identifying Which Linux System Library Contains a Function
Command Not Found in Bash's If-Else Condition When Using [! -D "$Dir"]