I can't reproduce the problems you have neither with bash nor ksh - maybe show what your test.sh contains when being executed and producing the wrong output.
Also please post the type of shell you are using, thanks.
and in your previous post also... If you are getting $INFO right it should work for all the scenarios..
Wait, this works for me:
I believe the problem is on sed!
---------- Post updated at 08:30 AM ---------- Previous update was at 08:26 AM ----------
Quote:
Originally Posted by zaxxon
I can't reproduce the problems you have neither with bash nor ksh - maybe show what your test.sh contains when being executed and producing the wrong output.
Also please post the type of shell you are using, thanks.
I test both with bash and with ksh.
You cannot reproduce since the test.sh create a specific command, then ftp that command on remote machine (OpenVMS), then execute it.
The output will be stored on /info.tmp file and is something like:
Do you think the problem is on output file that contains some "dirty" chars??
---------- Post updated at 08:35 AM ---------- Previous update was at 08:30 AM ----------
WAIT, PROBLEM SOLVED!!!!
Aa I thought, the output file contains "dirty chars", this will solve the issue:
Thanks all for solution, all of them work!
Ah ok. Just as additional info:
If you happen to have a Unix machine, that does not have dos2unix, you can use something like
to remove the Carriage Returns (CR).
Also if you want to check a file for unwanted characters, you can use
for example. You could see the additional CRs as \r iirc.
Hello All,
I have an input sample data like below (In actual I have many columns and few million rows).
Column1,Column2
4,2
1,5
Hello,4
1,4
Hello,2
3,5
Hello,8
4,5
Need the output (using awk and/or sed preferably) like below. Here I need all the lines between 2 matching... (1 Reply)
Hi Team
I have an huge xml where i need to search for a ceratin numbers. For example
2014-05-06 15:15:41,498 INFO WebContainer : 10 CommonServicesLogs - CleansingTriggerService.invokeCleansingService Entered PUBSUB NOTIFY MESSAGE () -
<?xml version="1.0" encoding="UTF-8"... (5 Replies)
Need Assistance in shell programming... I have a huge file which has multiple stations and i wanted to search particular station and extract few lines from it and the rest is not needed
Bold letters are the stations . The whole file has multiple stations .
Below example i wanted to search... (4 Replies)
Hi
I have a very large data file with several hundred columns and millions of lines.
The important data is in the last set of columns with variable numbers of tab delimited fields in front of it on each line.
Im currently trying sed to get the data out - I want anything beetween :RES and... (4 Replies)
Hi,
May i ask if someone share some command for extracting a string between 2 ref string in a txt file
My objective: i had a file with multiple lines and wants only to extract the string "watch?v=IbkAXOmEHpY" or "watch?v=<11 random character>", when i used "grep 'watch?=*' i got a results per... (4 Replies)
continuing from my previous post, whose link is given below as a reference
https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569
consider there is create table commands in a file for eg:
CREATE TABLE `Blahblahblah` (
`id` int(11) NOT NULL... (2 Replies)
hello forum members
I have txt file which consists the following information.
Server: abababa.xyz.ap.mxmx.com
Address: 111.143.211.202
Name: rmxd.ipc.ap.mxmx.com
Address: 144.111.99.9
from the abovefile i have to extract only string "rmxd.ipc.ap.mxmx.com" through awk command.... (1 Reply)
Hi, guys. I have one question:
I need to search for a string in a file, and then extract another string from the file and assign it to a variable.
For example:
the contents of the file (group) is below:
...
ftp:x:23:
mail:x:34
...
testing:x:2001
sales:x:2002
development:x:2003
...... (6 Replies)
needa c program to extract text between two delimiters from some text file.
and then storing them in to diffrent variables ?
text file like 0:
abc.txt
=========
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Hi,
I'm trying to use sed to extract some text and assign it to a variable.
Can anyone provide me with some help? it would be much appreciated!
I"m looking to extract for example:
filename=/output/R34/2005_13_R34_C1042S_T83_CRFTXT_20081015.txt
I'm trying to extract the 1042... (9 Replies)