Hi
through read i am taking standard input and redirecign them to a file
now from the same shell script i want to delete the password (i.e ${password}) so that no body can see my pssword
i tried this
this is not working.. is there any suggestion how can i delete the password from redirected file.lst ?
Last edited by Franklin52; 11-08-2014 at 01:55 PM..
Reason: Please use code tags
... ... ...
i tried this
sed -i 's/\$password//g' file.lst
this is not working.. is there any suggestion how can i delete the password from redirected file.lst ?
As has already been stated, you don't want to escape the $, but even after you fix that, variables aren't expanded inside single quotes. If you can't pass the variables through the environment as suggested by DGPickett, your sed command might work if you use double quotes:
but this will not work if $password expands to a string that contains a / or any character that has a special meaning in a basic regular expression (such as ., *, ?, [, \, or {). And, even if that isn't a problem, there is also the chance that the user's selected password will match other text in file.lst (and remove it) even though the text removed was not in the password field. (So, if someone knows what this file is supposed to look like, you could expose that user's password by removing the password.)
Rather than editing this file, it would be safer to just remove it.
Hi,
Pls check that '|' and '+' present in Step-1 are not copied to log file in Step-3.
Pls suggest how to get the exact output from Step-1 (i.e. with out losing '|' and '+') in to a log file
~Thanks
Step-1: Execute command
> mysql -utest -ptest -htesthost testdb -e "select * from... (3 Replies)
Hello everybody,
Having a file with the following content:
192.168.0.254->192.168.0.1
192.168.0.2->192.168.0.34
192.168.0.56->192.168.0.77
I need to code a program in C to read it from stdin redirection (i.e. root@box~# ./a.out < file), my question is, how can i do that?
I've tried with... (2 Replies)
currently, my samba login works just fine. i want my clients to use aix5.3 account to login to samba so they don't have to change samba pwd and aix pwd. i googled, and vi /usr/lib/smb.conf per some of knowledge base, but i could not get to work.
aix5.3 and samba 3.0.24.0
thanks in advace..... (2 Replies)
HI all,
I want to capture cpu data in batch mode of "top" command and redirect to a file like this:
top -b > cpu.dat
it works!
But I want to capture only Cpu lines, so i have:
top -b | grep ^Cpu >cpu.dat
Then I got an empty output file.
Why?
Could somebody explain and help me to make it... (15 Replies)
I have to confirm that an engine was not able to run. In the output below you see that it indeed got errors, but it didn't send those messages to the output file. When I run the same thing with a different executable it works. So does this mean something in the executable could cause it not to... (7 Replies)
hi,
Is there a way to access the redirected file inside the script. Here is what the command line looks like:
$ shar * > archive_file.arc
I know I can't access the name of archive_file.arc with positional parameters like $1, $2.. Is there any way to figure out what file the output of the... (3 Replies)
hi all,
i do search for a file in solaris box in the following format
find / -name 'file' -print 2>/dev/null
i tried the same thing on AIX box;
as i am searching from the root the same way i redirected the errors to /dev/null but find is showing strip off errors and when i just continued... (1 Reply)
Is this possible? I am attempting to display a new xterm window and tail -f the log file within that new window. I am currently working on a solaris 8 machine if that has any different meaning than the other platforms. As you can see, I am a newbie to this forum and to UNIX. Any help would be... (2 Replies)