10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am using sed command to extract data from my log file for a certain time interval. From and To "time" are my input arguments.
Now if i use the sed command on command line. I get the desired results and If i use it in script.It fails.
sed command as command line:
sed -n '/04-Mar-2015... (6 Replies)
Discussion started by: oberoi1403
6 Replies
2. Shell Programming and Scripting
I'm trying to change a date in a couple of large files using SED. The problem is when I use the -n parameter, it doesn't actually change the file. When I leave out the -n, it sends the whole file to the screen, but it does appear to change it.
The problem is, these files are very large and it... (8 Replies)
Discussion started by: Drenhead
8 Replies
3. Shell Programming and Scripting
I have this script to parse some logs:
#!/bin/bash
id=$1
shift
sed "/(id=$id)/,/^$/!d" "$@"
Usage: ./script.sh 1234 logfile
The logs have an empty line before the logged events/timestamps -- most of the time. And this is my issue, since when there is no empty line, it will catch things... (4 Replies)
Discussion started by: KidCactus
4 Replies
4. Shell Programming and Scripting
I can't get this code to work, could I get some help...
sed -i '' "s:${shLogpath1}${cell}:${shLogpath2}${cell}:g" test.txt
Any Ideas, I think I need to separate the variables some how? (2 Replies)
Discussion started by: digitalviking
2 Replies
5. Shell Programming and Scripting
Hi guys. Can somone advise as to what the problem is with the following sed command?
1) read -p "Please enter new username you wish to replace old: " new_username
sed "s/$username/$new_username/" information_file
;;
This is one of the case statements included but I'm... (1 Reply)
Discussion started by: jjb1989
1 Replies
6. Shell Programming and Scripting
Hi,
I'm developing my first bash script and have made good progress but stuck at this point.
I've run sed on a text file to extract some data and have saved it into a variable e.g.
$blah
the variable contains emails as follows e.g. <a@b.com> <b@c.com>
I'm now trying to edit... (2 Replies)
Discussion started by: newb1000
2 Replies
7. Shell Programming and Scripting
hi
i have following sed command
this replaces "** in filename1 with octal value 007 filename2
when i put it in script it wont work but it works from command line
my OS is sun OS
---------- Post updated at 06:38 PM ---------- Previous update was at 06:14 PM ----------
i... (10 Replies)
Discussion started by: er_zeeshan05
10 Replies
8. Shell Programming and Scripting
Hi All
I'm getting this error while executing a sed script
sed: 0602-404 Function /</ i\ File from New Cube: cannot be parsed.
sed "/</ i\ File from New Cube:
/>/ i\ File from Old Cube:" difference1.txt > Difference.txt
I've a file like this
< Y2008 Dec ..... .... ... 345
I want... (6 Replies)
Discussion started by: Celvin VK
6 Replies
9. Shell Programming and Scripting
Can someone help me "port" this to AIX sed?
sed '/nas/{n;s/true/false/}'
I know it doesn't like the ; but i don't know how else to do it.... never had to sed on an AIX box :D (7 Replies)
Discussion started by: DeviousPete
7 Replies
10. Shell Programming and Scripting
Execution of the following segment is giving the error -
Script extract:-
OUT=$DATADIR/sol_rsult_orphn.bcp
TMP1=${OUT}_tmp1
TMP=${OUT}_tmp
( isql -w 400 $dbConnect_OPR <<EOF
select convert(char(10), s.lead_id)
+'|'
+ s.pho_loc_type,
";",
s.sol_rsult_cmnt,
";",
+'|'+ s.del_ind... (3 Replies)
Discussion started by: kzmatam
3 Replies