Search Results

Search: Posts Made By: ag79
12,063
Posted By ag79
of course you can use a complicated awk script to...
of course you can use a complicated awk script to do this (and handle the cases when the sequence of data is something else than you gave above), but i would suggest you import the xml file in a...
1,760
Posted By ag79
or you not pass the variable, just break the awk...
or you not pass the variable, just break the awk string where you want your variable..

awk '/'"$var"'/{print $0}' file.txt
4,485
Posted By ag79
okay, i didnt understand your first post, but i...
okay, i didnt understand your first post, but i think you need to pass i as a parameter inside awk.. so here goes:

for(i=0;i<=6;i++)
{
awk -v value_of_i=$i '/param/ {print $2"=\"$"value_of_i"\""...
3,008
Posted By ag79
maybe do a mv rather than cp, then gzip, and then...
maybe do a mv rather than cp, then gzip, and then "touch $i" to create a new file?
4
Ftp
2,027
Posted By ag79
you can use this quickfix: ftp -i -v -n...
you can use this quickfix:
ftp -i -v -n 11.22.33.44 <<END_FTP
user username mypassword
binary
lcd /remote/directory
cd /local/directory
get filename
mget filenames
bye
END_FTP

-i Turns...
2,151
Posted By ag79
i see that at any point of time, you'll be...
i see that at any point of time, you'll be handling two files. since you're familiar with awk, the following may work for you, even though I agree perl might be a better tool for the job.

for...
2,704
Posted By ag79
dude, first, lose the caps. second, I think...
dude, first, lose the caps.

second, I think your problem lies with the way u handle Excel, not in Unix. If you convert all "|" to commas, the comma becomes a delimiter and "charan,devupalli"...
5,392
Posted By ag79
what exactly is the problem here? If you...
what exactly is the problem here?

If you want all of it on a single line, end the gsub func call with a semicolon (;), before the if.. starts.

You need to use the backslash as the last...
19,249
Posted By ag79
vari=$(your_command_here) or ...
vari=$(your_command_here)

or

vari=`your_command_here`

second example uses backticks, google it to learn more.
4,410
Posted By ag79
try this.. #!/bin/sh ...
try this..

#!/bin/sh

var='apasswordwith123splchars()/"*&/("*%andthe atsignyouwant@moretext@11.22.33.44'

#Get the total length
varlen=`echo $var | wc -c`
varlen=$((varlen))
...
2,270
Posted By ag79
okay, for you to know whether the command was...
okay, for you to know whether the command was successful or not, each of the three scripts have to return come sort of code, like 0 for success and nonzero for failure.

then, you write a wrapper...
4,410
Posted By ag79
as i understand, you need to get the ip address...
as i understand, you need to get the ip address out, so that you can connect. you cannot assume things in password, because a password may contain an ip address itself (!!)
i think you need to parse...
2,547
Posted By ag79
my guess is that you'll need to escape the inner...
my guess is that you'll need to escape the inner backticks.. try it out and see if it works..

in my opinion it makes the code, well, a little difficult to understand and maintain by an average...
13,996
Posted By ag79
ftp -nv $hostname << END quote user $UID ...
ftp -nv $hostname << END
quote user $UID
quote pass $pwd
binary
put $source_file
quit
END
rc=$?
echo "Return Code:$rc"
if [ $rc -ne 0 ]
then
echo "$ScriptName: Error in ftp the file...
3,097
Posted By ag79
read this post on how to increment dates in...
read this post on how to increment dates in YYYYMMDD format
https://www.unix.com/shell-programming-scripting/29757-date-increment-format-yyyymmdd.html

make a loop around those files and addup...
6,503
Posted By ag79
if you want to automate an ftp securely, you'll...
if you want to automate an ftp securely, you'll need non interactive authentication.
see man pages for sshd, ssh-keygen, and sftp for more details.

there are already several hundred pages on the...
6,503
Posted By ag79
this is wrong if [[ $1 != "dm5admin" ]] ...
this is wrong
if [[ $1 != "dm5admin" ]]
here's what is going wrong: shell cant understand the following when u dont pass anything:
if [[ != "dm5admin" ]]


this is what you need
if [ "$1" !=...
3,381
Posted By ag79
thnx guys, i did some minor mod, this works for...
thnx guys, i did some minor mod, this works for me:
grep -v -E "\.abc*:[ \t]*!" file
3,381
Posted By ag79
regular expression
Hello All!

I have a file thats something like this: ( a grep output)


/path/of/file/filename.abc.xyz.pqr:! Commented text
/path/of/file/filename.abc.xyz: ! More Commented text

I need to...
13,669
Posted By ag79
Hello All, Fortunately in the system that...
Hello All,

Fortunately in the system that I'm working on, I know all the scripts that are scheduled using the various scheduler apps, or are manually executed, so I know all the "starting points"....
1,859
Posted By ag79
you need to provide more information. is it a...
you need to provide more information. is it a shell script? is it an sql output?
if you need to see all 30 columns why dont you delimit the file columns if not already done and open the file in any...
13,669
Posted By ag79
Thanks jgt and ShawnMilo. jgt: he solution...
Thanks jgt and ShawnMilo.

jgt: he solution will work, and I'm exploring this option.

ShawnMilo: Your solution is similar to shamrock's conceptually. I'm slightly wary of this solution because...
13,669
Posted By ag79
Thanks shamrock.. The basic objective here...
Thanks shamrock..

The basic objective here is to find out which scripts are being used and which ones are not, by having a trace of execution without actually executing (bypassing the control...
13,669
Posted By ag79
Shell Script Dependency/Tracer
Hello All,

We have a very old system at hand in which there are hundreds of shell scripts that use other shell scripts, all on the same server. There are several that are not used at all as well....
2,692
Posted By ag79
use expr with % operator. n%100 will give you...
use expr with % operator. n%100 will give you remainder so u'll get two digits.
u can use substr to extract two digits after decimal.

it's easier to use awk/cut. anyway, ur choice :)
Showing results 1 to 25 of 33

 
All times are GMT -4. The time now is 04:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy