Search Results

Search: Posts Made By: samrat dutta
2,583
Posted By Don Cragun
With the output from the echo commands you showed...
With the output from the echo commands you showed us in post #7 in this thread, it appears that the tr and while read loop are behaving as expected. What makes you believe that it is not working...
2,583
Posted By Aia
Please, remove the echo. I presume that it was...
Please, remove the echo. I presume that it was there for testing purposes.
2,583
Posted By RudiC
How about tr ',' '\n' <file | while read node; do...
How about tr ',' '\n' <file | while read node; do echo cfsend n:"${node}" port:4645 trtype:c rcmd:"pwd"; done
2,583
Posted By Aia
#!/bin/bash ...
#!/bin/bash

PROP_FILE="/usr/opt/temp/aorc.prop"

while IFS="=" read node trup; do
cfsend n:"${node}" port:4645 trtype:c rcmd:"pwd" >> out.txt
done < ${PROP_FILE}
Forum: Linux 08-27-2015
14,706
Posted By RudiC
You need to preserve the exit code of output=`ps...
You need to preserve the exit code of output=`ps aux|grep hawkagent` , e.g by adding a temporary variable immediately after the command: TMP=$? and checking that afterwards. Or try sth. likeif...
Forum: Linux 08-27-2015
14,706
Posted By Scrutinizer
Hi, if [[ $? -eq 0 ]] will not work since...
Hi,

if [[ $? -eq 0 ]]
will not work since the the previous command:
pid=$2
will always render return code 0

Try this instead:
if [ $# -gt 0 ]

--
You could also use grep's return code:...
Forum: Linux 08-11-2015
4,263
Posted By RudiC
The error msgs are correct - there's no sed...
The error msgs are correct - there's no sed command, just addresses. Trysed "s/CompInsName/$CompInsName/;s/DepName/$DepName/g" file but make sure the variables don't have "/" in them.
Forum: Linux 08-11-2015
4,263
Posted By vbe
where is the $ for the variable? e.g. /$DepName/
where is the $ for the variable? e.g. /$DepName/
8,499
Posted By Akshay Hegde
Fine, use this code #!/bin/bash # Use...
Fine, use this code

#!/bin/bash

# Use your $1 arguments here
client="client_ftx"

# Your FTP Control file
control_file="controlfile"

while read line
do

[[ "$line" =~ ^\[ ...
984
Posted By alister
If you look at your AWK man page or search for...
If you look at your AWK man page or search for AWK tutorials online, you'll quickly find the answer to you $0 question.

/ is a regular expression delimiter and \ is used to escape the character...
984
Posted By Jotne
Then this should do it awk...
Then this should do it
awk 'a=match($0,/\|BBG.........\|/) {print substr($0,a+1,12)}' file

Does your file have other types of filed, other with of field?
awk -F\| '{print $2}' file
2,490
Posted By Don Cragun
This sed command does not care how many columns...
This sed command does not care how many columns are in its input file; it prints lines from its input if and only if the first character on the line is a digit. Since all of the header and trailer...
6,411
Posted By Corona688
Again, you need spaces around those [ ] , you...
Again, you need spaces around those [ ] , you can't just jam it all together.

if ! [ -f /app/reporting/daily/temp/abc.OK ] ; then
echo "missing"
fi
6,411
Posted By Corona688
You can't cram an if-statement together like...
You can't cram an if-statement together like that, spaces are needed around each token.

Also, you need if [ -f filename ] to look for a filename. But it takes one, and only one filename -- not...
2,103
Posted By RudiC
Assuming the column name is a field in row 1,...
Assuming the column name is a field in row 1, tryawk -F\| 'NR==1 {for (i=1; i<=NF; i++) if ($i==COLNAME){COL=i; break}} !L[$COL]++' COLNAME="auditid" fileYou can use the column name as a constant...
Showing results 1 to 15 of 15

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