Will UID and PWD always be on the same line in File1?
Do you really want the spaces between the quotes in the updated File1?
Can UID or PWD appear more than once in File1?
Its not what you are thinking. Am just trying it with shell. I just want to know whether it is possible in shell or not.
My approach is that i will store the UID and PWD as variables in file2. I will write a script file3.sh
file3.sh:
No need of any spaces. it should look like this.
Thanks,
Last edited by Don Cragun; 03-12-2015 at 04:31 AM..
Reason: Add CODE tags.
Its not what you are thinking. Am just trying it with shell. I just want to know whether it is possible in shell or not.
My approach is that i will store the UID and PWD as variables in file2. I will write a script file3.sh
file3.sh:
No need of any spaces. it should look like this.
Thanks,
In the 1st post in this thread you said File2 (note the uppercase F) contains the code:
You haven't told us what OS or shell you're using, but there are at least two problems here:
A file named File2 can't be loaded using the command . file2. (On UNIX and Linux systems, file names are case sensitive.)
The commands in File2 are not assignment statements. They invoke the utility named UID with the operand -admin and the utility named PWD with the operand =password.
If you set the contents of file2 to be valid shell variable assignments as clx suggested:
(Note that there are no spaces around the = in either of these commands), then the following commands in file3 should do what you want:
I generally prefer using the Korn shell, but this should work with any POSIX conforming shell or any shell that accepts basic Bourne shell syntax.
Hi
I've to remove the files which has the following file pattern in path /home/etc/logs
fnm_HST_date1
fnm_hst_date1
fnm_HST_date2
I've used the following code to to remove the files having file names like "HST" .
#!/usr/bin/ksh
set -x
file_path=/home/etc/logs
file_nm=HST
find... (2 Replies)
Pleeeeease help..
I'm working in perl
i have a system function to check whether a file is readable for others or not.
i just want to print a text in that command
my command is :
system ("ls -la $filename | awk '\$1~ /^-......r../ {print \$9}'");
i know for displaying text in awk... (6 Replies)
Good evening to all!!
I'm facing this problem:
I saved in a txt a list of files name (one txt for every folder):
hello0.jpg
hello1.jpg
hello10.jpg
hello11.jpg
hello12.jpg
hello13.jpg
hello14.jpg
hello15.jpg
hello16.jpg
hello17.jpg
hello18.jpg
hello19.jpg
hello2.jpg
hello20.jpg... (32 Replies)
Objective:
Recursively search all files under a directory for SQL statements that end with ";"
Sample input:
UPDATE table1
set col=val
UPDATE table2
set cola=vala
,colb=valb;
UPDATE table3
set col=val
Expected output:
UPDATE table2
set cola=vala
,colb=valb; (1 Reply)
I need to extract strings from a file.
The file contains data like:
Plan ABCD
IN-+-172BB---118C2C---GGN_342-+-MM77_23--+-LAS24_3|GGK_774
| | \-LAS24_2|GGN_774
| +-AA_800_1-+-BAS_000|GGK_362
| | \-BAS_001|GGK_360
| \-DD_000T1---DAM_001|STEEL_0
Plan SHELL_1... (3 Replies)
Hi,
I'm trying to remove rows that including specific word, but the below is replacing only the first occurrence, how to do this for the all occurrences within the file.
grep -v "mdsMVLink\|mdsMVMembership\|mdsMVLinkType" sfile.txt > dfile.txt
Could someone help me how to accomplish this?
... (2 Replies)
Hi All ,
I need to extract the strings that are matching with the pattern : CUST.<AnyStringOfAnyLength>.<AnyStringOfAnyLength> from a file and then write all these string into another file.
e.g. If a file SOURCE contains following lines :
IF(CUST.ABCD.EFGH==1) THEN
CUST.ABCD.EFGH =... (7 Replies)
Hi,
I have a sql file that runs something like this
vi Test.sql
REVOKE EXECUTE ON DEMO_USER.SQC_SAMP FROM PUBLIC;
REVOKE EXECUTE ON DEMO_USER.SQC_SAMP FROM DEMO_READ;
REVOKE SELECT ON DEMO_USER.DEMO_NOMINEE_TEST FROM DEMO_READ;
REVOKE EXECUTE ON DEMO_USER.SQC_SAMP FROM... (3 Replies)
I need to grep for a pattern in a file. Files are huge and have several repeated occurances of the strings which match pattern. I just need the strings which contain the pattern in the output.
For eg.
The contents of my file are as follows. The pattern I want to match by is ABCD
... (5 Replies)
Hi Friends,
Please help me with the following problem:
I have an xml file with the following lines:
<init-param>
<param-name>/default/directory</param-name>
<param-value>default</param-value>
</init-param>
<init-param>
... (5 Replies)